Lists & Tuples in Python (How to Use Them Effectively?) #15

Поделиться
HTML-код
  • Опубликовано: 23 дек 2024

Комментарии • 89

  • @programizstudios
    @programizstudios  2 года назад +6

    🔥 Learn Python with a more hands-on experience with Programiz PRO-interactive lessons, quizzes & challenges.
    Try Programiz PRO: bit.ly/right-python

  • @saiful_khalid
    @saiful_khalid 3 года назад +22

    We are so lucky that these videos are free. Thank you Programiz

  • @rashedzaman990
    @rashedzaman990 Год назад +2

    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.

  • @pandathegeneral2426
    @pandathegeneral2426 3 года назад +5

    Im getting better at coding because of this channel THANK YOU SO MUCH im going to push myself until i become a game dev!

  • @घटिया_कानून
    @घटिया_कानून Год назад +1

    "guruji"
    clearest,easiest,simplest
    Its great asset for students
    to learn python

  • @kawaiikina3618
    @kawaiikina3618 2 года назад +2

    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!!

  • @hadeerrashad5486
    @hadeerrashad5486 3 года назад

    This is the BEST video I have ever watched that explained the concepts perfectly.

  • @beastashwin1923
    @beastashwin1923 3 года назад +4

    This video is really helpful, short and to the point! Thanks a lot ❤️

  • @danielakoyleek3757
    @danielakoyleek3757 2 года назад

    My guy! explicit teacher. Cheers from South Sudan❤!!!

  • @duongminh1972able
    @duongminh1972able 3 года назад +2

    You present in a clear way. Thank you

  • @tharuna6205
    @tharuna6205 2 года назад +1

    Underrated channel

  • @daviddavila8289
    @daviddavila8289 2 года назад

    12:15 Punit, why is the item “JavaScript” printed in a different color?

  • @khaledelhoushi8834
    @khaledelhoushi8834 Год назад

    You can also call the length function on slicing. You can do it like this print(len(languages[0:3])).

  • @saregamapaz
    @saregamapaz 3 года назад

    very clear and methodical presentation...THANKS

  • @AbdulrahmanMuttakaJunju
    @AbdulrahmanMuttakaJunju Год назад

    really interesting videos. however am having challenge solving a problem related to tuple, can you be of help?

  • @Knochenkotzer01
    @Knochenkotzer01 2 года назад

    Super great content Programiz, keep it up ✨

  • @adeebalamat172
    @adeebalamat172 2 года назад

    I can pass my test now thanks to you

  • @ganneruvaramroshinichitti5407
    @ganneruvaramroshinichitti5407 3 года назад

    thankyou sir .its really simply more explanative...

  • @edselnarvaez9667
    @edselnarvaez9667 2 года назад

    Punit you are the best thanks a lot !

  • @DigitalAcademyOnline
    @DigitalAcademyOnline 3 года назад +2

    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

  • @nriezedichisom1676
    @nriezedichisom1676 3 года назад +1

    Videos are perfect

  • @jitendrakasaudhan
    @jitendrakasaudhan 4 года назад +2

    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 !! :) 👍

  • @kiran12314
    @kiran12314 3 года назад

    Classes are very easy to understand

  • @srhrithik5259
    @srhrithik5259 2 года назад

    Thank you programiz

  • @OptimusPrime-vy8vy
    @OptimusPrime-vy8vy 4 года назад +1

    This is really well done thank you!

  • @theonlymaster9374
    @theonlymaster9374 2 года назад +2

    1. True
    2. ['Hello', 'Hi', 'java', True]
    Traceback (most recent call last):
    File "", line 7, in
    TypeError: 'tuple' object does not support item assignment
    >

  • @ahmedyousif4782
    @ahmedyousif4782 4 года назад +1

    why the sound changed?

  • @sg8581
    @sg8581 Год назад

    Great videos, thanks a ton!

  • @adityagupta8950
    @adityagupta8950 2 года назад

    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.

  • @stefmyt5062
    @stefmyt5062 3 года назад

    Amazing video, sir! Very useful!

  • @SANGITA_SINGH1981
    @SANGITA_SINGH1981 3 года назад

    Your videos are really very great

  • @mateenbutt3180
    @mateenbutt3180 3 года назад

    hi, is it possible using .insert() on list, we treat list or tuple we want to add as like .extend() treats ?

  • @BalaKrishnan-qk2zu
    @BalaKrishnan-qk2zu 3 года назад

    This video is really helpful. Thanks a lot

  • @ohjinyoung4931
    @ohjinyoung4931 2 года назад

    Very good!

  • @lukedsouza7
    @lukedsouza7 4 года назад +1

    Thanks Great Job!

  • @joyceadhiambo9977
    @joyceadhiambo9977 2 года назад

    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)

  • @srhrithik5259
    @srhrithik5259 2 года назад

    Thanks a lot 🤗🤗

  • @westonholmes9503
    @westonholmes9503 2 года назад

    These videos are great

  • @GiulioVonKerman
    @GiulioVonKerman 3 года назад

    How can I change the position of an item in a list?

  • @kapibara2440
    @kapibara2440 11 месяцев назад

    Super video, thank you❤

  • @saurav2409
    @saurav2409 3 года назад

    Thank u so, to this precised n to the point lecture ... 🥺

  • @majidalich2947
    @majidalich2947 2 года назад +1

    1. True
    2. ['Hello', ' Hi', 'Java' , 'True' ]
    error : you cant use assignment operator in case of tuples
    3. (1,3,4,5)

  • @georg101
    @georg101 4 года назад

    I am waiting for more!

  • @mohammedumair2968
    @mohammedumair2968 4 года назад +2

    Good explanation sir 👏ossom
    Sir please make videos on *Data structure* sir please....

  • @abdulquadiransari7476
    @abdulquadiransari7476 4 года назад +1

    hey why the website went down . Why I am I unable to load the website?

    • @rayar2323
      @rayar2323 4 года назад

      The website is up and running now

  • @ensonev8768
    @ensonev8768 3 года назад

    Awesome. Keep going

  • @gabrielladangler1722
    @gabrielladangler1722 4 года назад +1

    Awesome videos! Looking forward to the next one! :)

  • @kyrank.4321
    @kyrank.4321 3 года назад

    Great videos, keep it up!!!

  • @sandipansarkar9211
    @sandipansarkar9211 3 года назад

    great explanation

  • @sureshvarthya2250
    @sureshvarthya2250 2 года назад

    True
    ["Hello", "Hi", "Java", True]
    error it does not support for reassigning values into the tuple ,because it is immutable

  • @shankarsai2067
    @shankarsai2067 4 года назад +5

    Why don't we have a live interaction session with Punit sir????

  • @lakshanj.kumara7648
    @lakshanj.kumara7648 Год назад

    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)

  • @EmereEmmanuel
    @EmereEmmanuel 2 месяца назад

    My answer, hope i am doing well.
    1. ["True"]
    2. ["Hello", "Hi", "Java", "True"]
    3. [1, 100, 4, 5]

  • @harish0000
    @harish0000 4 года назад

    Please also alow us to save our code in python compiler which is on your site

  • @nithyanagendran5661
    @nithyanagendran5661 3 года назад

    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 ?

    • @tizestaxd
      @tizestaxd 3 года назад +1

      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

  • @mohammadabdullahaalforhad1375
    @mohammadabdullahaalforhad1375 2 года назад

    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

  • @favourudoh753
    @favourudoh753 3 года назад

    amazing!!

  • @mohammadabdullahaalforhad1375
    @mohammadabdullahaalforhad1375 2 года назад

    Thanks

  • @mateenbutt3180
    @mateenbutt3180 3 года назад

    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]]

    • @AryanSingh-ju6wn
      @AryanSingh-ju6wn 3 года назад

      with .copy() it must not be creating a new memory location but rather linking the previous one to the new variable

  • @shadoestorme
    @shadoestorme 4 года назад

    thank you!

  • @praveenasurya3211
    @praveenasurya3211 2 года назад

    can you add subtitles too sir?

  • @Trazynn
    @Trazynn 4 года назад +1

    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.

    • @programizstudios
      @programizstudios  4 года назад +27

      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.

  • @saravanaakavi2376
    @saravanaakavi2376 3 года назад

    will you make a video as per viewer request?

  • @ahmedaltaf12131
    @ahmedaltaf12131 4 года назад

    thank you so much omg

  • @cadribopraiseoyo5636
    @cadribopraiseoyo5636 3 года назад

    Instructor what's your name? I like your tutorials a lot.

  • @harshad9203
    @harshad9203 3 года назад

    1. 4
    2. hello, hi, java, true
    3. error

  • @ranjeet5806
    @ranjeet5806 3 года назад +2

    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

  • @kushal-shaw-pvt
    @kushal-shaw-pvt 4 года назад +1

    Sir please teach tkinter

  • @karanbirsingh5924
    @karanbirsingh5924 3 года назад

    Lets we have 3 reviewers and 4 movies......how to code this

  • @sunnyraut3243
    @sunnyraut3243 3 года назад

    1.True
    2.Hello Hii Java True
    3.Error cannot assign value to tuple

  • @datasciencetoday7127
    @datasciencetoday7127 9 месяцев назад

  • @kemaketseforkssebitiela3089
    @kemaketseforkssebitiela3089 5 месяцев назад

    ❤i think i am going somewhere😅

  • @emrandafadar4445
    @emrandafadar4445 2 года назад

    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