Learn Python with a more hands-on experience with Programiz PRO. 🚀 Get 60% off on our Lifetime Plan this Black Friday-pay once for skills that last forever. Don’t miss out, it’s a limited-time offer! 👉 Grab your discount now: bit.ly/blkfriday-py-24-yt
I have been lately watching a lot of videos but Punit, he truly stands out. His teaching method is awesome. Those who are struggling to understand Decorators in Python, I will strongly recommend them to watch Punit’s video on Decorators in Python.
Thank you Punit and Programiz team's effort! Your videos are the best tutorials I have come across which provide clear explanation on the code structures and are sooooo easy to follow!!
Learning Python is something you would like to get in your skills, but you do not know where to start? This NEW channel will help you out leaning Python Programming from scratch - for complete Beginners, Intermediate and Advanced Levels
you can not change the elements of a tuple .hence this is the output mixed_list=['Hello',-34,'Java',True] mixed_list[1]='Hi' print('2.',mixed_list) print('1.',mixed_list[-1]) mixed_tuple=(1,3,4,5) mixed_tuple[1]=100 print('3.',mixed_tuple)
I really like all your video tutorials :) its simple , clean and clear :) BTW which tool do you use to edit/create these videos ? it looks great !! :) 👍
sir if we want to change 2nd and last element of list at once then what we will use?.I tried this but its results in reducing of size of list.the immediate element after the first index value is only there and rest of the elements in list is removed.
I understand that tuples are faster and make more efficient use of memory. But is that their only purpose? They do seem to require a lot more effort than just using a list.
No, efficiency is not the primary reason to use tuples. In fact, the difference in efficiency is insignificant for 99.9% of the applications. The primary benefit of using tuples is that it helps us create less error-prone code. For example, Imagine you own an ecommerce site and you need to send emails to all the users regarding a new policy change. To do so, you decided to store all the emails (from the database) in a collection so that you can send the emails at once. In such cases, it's better to use tuples because we know for sure that these emails won't change throughout the execution of the program. And if the tuple is accidentally modified by you or other developers, we get an error (which is a good thing). This helps us create less buggy code. Also, using a tuple makes our code more readable. It's because when we see a tuple we know for sure that this data cannot be modified.
Hello Sir, am having a doubt. I tried the following code . languages = ["Python","Java","Kotlin","C++"] languages[1:4] = ["Ruby","JS"] print(languages) and the result i got is : ------------------------------------- ['Python', 'Ruby', 'JS'] Why Kotlin didn't get printed ? what is wrong in this ?
because you wrote 1:4 it should be 1:3 look languages = ["Python","Java","Kotlin","C++"] languages[1:3] = ["Ruby","JS"] print(languages) result ['Python', 'Ruby', 'JS', 'C++'] I hope i helped u have a good day
Answer of the Exercise : 1.True 2.Hello---- edit: it prints the whole list a error that you cant use assignment operator in case of tuples 3.1---- edit: it prints the whole tuple
Your explaining style is very hard to understand You speak too fast You're writing your codes too fast And supporting logics aren't many And your coding font size is very small I am fully beginner, I can't catch it fast like others
Learn Python with a more hands-on experience with Programiz PRO.
🚀 Get 60% off on our Lifetime Plan this Black Friday-pay once for skills that last forever. Don’t miss out, it’s a limited-time offer!
👉 Grab your discount now: bit.ly/blkfriday-py-24-yt
100% right
Where I can find the explanation video for the task?
I have been lately watching a lot of videos but Punit, he truly stands out. His teaching method is awesome. Those who are struggling to understand Decorators in Python, I will strongly recommend them to watch Punit’s video on Decorators in Python.
We are so lucky that these videos are free. Thank you Programiz
"guruji"
clearest,easiest,simplest
Its great asset for students
to learn python
Im getting better at coding because of this channel THANK YOU SO MUCH im going to push myself until i become a game dev!
This is the BEST video I have ever watched that explained the concepts perfectly.
Thank you Punit and Programiz team's effort! Your videos are the best tutorials I have come across which provide clear explanation on the code structures and are sooooo easy to follow!!
The best
My guy! explicit teacher. Cheers from South Sudan❤!!!
Underrated channel
This video is really helpful, short and to the point! Thanks a lot ❤️
You present in a clear way. Thank you
1. True
2. ['Hello', 'Hi', 'java', True]
Traceback (most recent call last):
File "", line 7, in
TypeError: 'tuple' object does not support item assignment
>
I can pass my test now thanks to you
mixed_list=["hello",-34,"java",True]
print("1.",mixed_list[-1])
mixed_list[1]="Hi"
print("2.",mixed_list)
mixed_tuple=(1,3,4,5)
print("3.",mixed_tuple)
My answer, hope i am doing well.
1. ["True"]
2. ["Hello", "Hi", "Java", "True"]
3. [1, 100, 4, 5]
mixed_list = ('Hello!', -34,'java', True )
print('1.', mixed_list[0])
print('2.', mixed_list[1])
print('3.', mixed_list[2])
print('4.', mixed_list[3])
1. Hello!
2. -34
3. java
4. True
You can also call the length function on slicing. You can do it like this print(len(languages[0:3])).
Learning Python is something you would like to get in your skills, but you do not know where to start? This NEW channel will help you out leaning Python Programming from scratch - for complete Beginners, Intermediate and Advanced Levels
really interesting videos. however am having challenge solving a problem related to tuple, can you be of help?
you can not change the elements of a tuple .hence this is the output
mixed_list=['Hello',-34,'Java',True]
mixed_list[1]='Hi'
print('2.',mixed_list)
print('1.',mixed_list[-1])
mixed_tuple=(1,3,4,5)
mixed_tuple[1]=100
print('3.',mixed_tuple)
very clear and methodical presentation...THANKS
Classes are very easy to understand
thankyou sir .its really simply more explanative...
Punit you are the best thanks a lot !
I really like all your video tutorials :) its simple , clean and clear :) BTW which tool do you use to edit/create these videos ? it looks great !! :) 👍
Thank you programiz
Super great content Programiz, keep it up ✨
Why don't we have a live interaction session with Punit sir????
Punit raj kumar 🤧
1. True
2. ['Hello', ' Hi', 'Java' , 'True' ]
error : you cant use assignment operator in case of tuples
3. (1,3,4,5)
Your videos are really very great
12:15 Punit, why is the item “JavaScript” printed in a different color?
Great videos, thanks a ton!
Videos are perfect
why the sound changed?
sir if we want to change 2nd and last element of list at once then what we will use?.I tried this but its results in reducing of size of list.the immediate element after the first index value is only there and rest of the elements in list is removed.
This is really well done thank you!
hi, is it possible using .insert() on list, we treat list or tuple we want to add as like .extend() treats ?
Very good!
These videos are great
This video is really helpful. Thanks a lot
Amazing video, sir! Very useful!
Good explanation sir 👏ossom
Sir please make videos on *Data structure* sir please....
Walla habibi
great explanation
1. 4
2. hello, hi, java, true
3. error
Thanks Great Job!
Thanks a lot 🤗🤗
Thank u so, to this precised n to the point lecture ... 🥺
I am waiting for more!
Awesome. Keep going
Awesome videos! Looking forward to the next one! :)
Why output are same? when I use .copy() method.............
old_list = [[1, 2, 3], [4, 5, 6], [7, 8, 'a']]
new_list = old_list.copy()
old_list[2][2] = 10
print('Old List:', old_list)
print('New List:', new_list)
Output:
Old List: [[1, 2, 3], [4, 5, 6], [7, 8, 10]]
New List: [[1, 2, 3], [4, 5, 6], [7, 8, 10]]
with .copy() it must not be creating a new memory location but rather linking the previous one to the new variable
How can I change the position of an item in a list?
Great videos, keep it up!!!
True
["Hello", "Hi", "Java", True]
error it does not support for reassigning values into the tuple ,because it is immutable
Please also alow us to save our code in python compiler which is on your site
Thanks
I understand that tuples are faster and make more efficient use of memory. But is that their only purpose? They do seem to require a lot more effort than just using a list.
No, efficiency is not the primary reason to use tuples. In fact, the difference in efficiency is insignificant for 99.9% of the applications.
The primary benefit of using tuples is that it helps us create less error-prone code.
For example,
Imagine you own an ecommerce site and you need to send emails to all the users regarding a new policy change. To do so, you decided to store all the emails (from the database) in a collection so that you can send the emails at once.
In such cases, it's better to use tuples because we know for sure that these emails won't change throughout the execution of the program. And if the tuple is accidentally modified by you or other developers, we get an error (which is a good thing). This helps us create less buggy code.
Also, using a tuple makes our code more readable. It's because when we see a tuple we know for sure that this data cannot be modified.
will you make a video as per viewer request?
hey why the website went down . Why I am I unable to load the website?
The website is up and running now
Super video, thank you❤
Hello Sir, am having a doubt. I tried the following code .
languages = ["Python","Java","Kotlin","C++"]
languages[1:4] = ["Ruby","JS"]
print(languages)
and the result i got is :
-------------------------------------
['Python', 'Ruby', 'JS']
Why Kotlin didn't get printed ? what is wrong in this ?
because you wrote 1:4 it should be 1:3
look
languages = ["Python","Java","Kotlin","C++"]
languages[1:3] = ["Ruby","JS"]
print(languages)
result
['Python', 'Ruby', 'JS', 'C++']
I hope i helped u have a good day
amazing!!
Instructor what's your name? I like your tutorials a lot.
can you add subtitles too sir?
Answer of the Exercise :
1.True
2.Hello---- edit: it prints the whole list
a error that you cant use assignment operator in case of tuples
3.1---- edit: it prints the whole tuple
thank you!
thank you so much omg
1.True
2.Hello Hii Java True
3.Error cannot assign value to tuple
Sir please teach tkinter
Lets we have 3 reviewers and 4 movies......how to code this
❤i think i am going somewhere😅
Your explaining style is very hard to understand
You speak too fast
You're writing your codes too fast
And supporting logics aren't many
And your coding font size is very small
I am fully beginner, I can't catch it fast like others