Python Lists || Python Tutorial || Learn Python Programming

  • Published on Apr 13, 2016
  • Lists are a way to store ordered data. In this Python tutorial, we show you how to create lists, access elements by index, slice lists, join two lists (concatenation), and more. We will talk about sets, dictionaries and tuples in separate videos.
    To learn Python, you can watch our playlist from the beginning:
    We recommend:
    Python Cookbook, Third edition from O’Reilly
    The Mythical Man Month - Essays on Software Engineering & Project Management
    Shop Amazon Used Textbooks - Save up to 90%
    Subscribe to Socratica:
    To support more videos from Socratica, visit
    Socratica Patreon
    Socratica Paypal
    We also accept Bitcoin! :)
    Our address is: 1EttYyGwJmpy9bLY2UcmEqMJuBfaZ1HdG9
    Python instructor: Ulka Simone Mohanty
    Written & Produced by Michael Harrison
    FX by Andriy Kostyuk

Comments • 120

  • Socratica
    Socratica  Month ago +8

    It's official! The Socratica Python Kickstarter was a success! Thank you to all of our supporters. Because of you, many more Python videos coming soon!! 💜🦉

    • Lilahao
      Lilahao Month ago

      Socratica this video was so helpful before my test tomorrow, thank you! 💓

  • Luka Iashvili
    Luka Iashvili 4 days ago

    Simply Awesome, Thank you!!

  • Pushkar Raj
    Pushkar Raj Month ago

    Well explained ma'am.. thanks a lot. Plz discuss Python array too.. I m confused to see array coz its looks like list..
    And your video is so fast. It has to be pause many times to see, understand and grasp it..

  • Socratica
    Socratica  Month ago


  • Socratica
    Socratica  2 months ago

    We're halfway there. We still need your help! Support Socratica Python Kickstarter:

  • Socratica
    Socratica  2 months ago +1

    Support what you love! Socratica has a Kickstarter to make more Python:

  • mahdi bahrami
    mahdi bahrami 4 months ago

    Imagine these lists:
    [1, 3, 4, 5, 6, 7]
    [4, 5, 4, 6, 8, 9, 11, 34]
    How do you get a list from second item on those lists to the end but not the last 2 items from each list?

    • Paul Gross
      Paul Gross 18 days ago

      Slice with [1: -2] like this:
      list1 = [1, 3, 4, 5, 6, 7]
      list2 = [4, 5, 4, 6, 8, 9, 11, 34]
      list1[1: -2]
      *[3, 4, 5]*
      list2[1: -2]
      *[5, 4, 6, 8, 9]*

  • Jonathan Davis
    Jonathan Davis 5 months ago

    how does she do the sound effects and background, so cool

  • Singularity
    Singularity 5 months ago +2

    *socratica:* "Lists start at zero..."
    *lua:* "Them fighting words!"

  • leathernluv
    leathernluv 6 months ago +1

    To get the list reversed, but not reverse the list in place: example[::-1]
    That way you get the reverse without changing the list order. I figured that one out via typo.

  • Alexander Zhang
    Alexander Zhang 6 months ago


  • ShakespeareCafe
    ShakespeareCafe 6 months ago

    This woman looks and sounds exactly like Wendy Rhoades on Showtime's Billions, which is one of the best shows after Breaking Bad

  • Esteban Escudero
    Esteban Escudero 7 months ago

    I really enjoy your videos. You make learning very easy and interesting. Thumbs up for the length of each video also. They are short as they should, but with plenty of useful info. You have won a subscriber. :)

  • Yamkela Balisa
    Yamkela Balisa 7 months ago

    what does the return statement actually do in python?
    im still a beginner

    • Yamkela Balisa
      Yamkela Balisa 7 months ago

      can one clear makes more than one example for me, 2 or 3 will be enough

  • Venkat Gurram
    Venkat Gurram 9 months ago

    very creative presentation with sci-fi feel. The girl is a good actor and has the looks.

  • Linda Tochukwu
    Linda Tochukwu 9 months ago +1

    on point ur charisma

  • Ismael Amorim
    Ismael Amorim 9 months ago

    Super maravilhoso essas Aulas

  • William Smith
    William Smith 10 months ago

    uh how do you find the amount of values in a list

  • S M Fahim
    S M Fahim 10 months ago

    when I use:
    I get some results and the first 3 are:
    '__add__', '__class__', '__contains__'
    But how to use these classes which contains double underscores?

  • Yousif Ahmed
    Yousif Ahmed 11 months ago

    You are very great. Thank you a lot

  • Hritik Vashishth
    Hritik Vashishth 11 months ago

    she sounds exactly like cortana from halo

  • Elias Alirio Moran Saget
    Elias Alirio Moran Saget 11 months ago

    You are fun :)

  • eng
    eng 11 months ago +1

    Please make a udemy or Udacity course for Python would definitely buy

  • Vasconcelos
    Vasconcelos 11 months ago

    thank you for do this videos

  • MD Sadaquat hussain
    MD Sadaquat hussain 11 months ago

    Guys check out telusko also..its a good source for beginners with around 74 videos..Thank me later😀

  • Naat Status
    Naat Status Year ago

    Great video but I think there is some missing...........!!!!

  • Kizito Bukenya
    Kizito Bukenya Year ago

    This an amazing video

  • Spyder Spyder
    Spyder Spyder Year ago

    Very good tutorial. I liked it

  • Tamer Aziz
    Tamer Aziz Year ago


  • ehud ezra
    ehud ezra Year ago

    hi, I need an example of inputting a list(i have a numbers list) with a square parenthesis and a comma from the user. the sooner the better. thank you so much, your clips help so much, I can't thank you enough.

  • cornelxbox25
    cornelxbox25 Year ago +1

    Socratica.... You just made the list!!!

  • Daniel Fernandes
    Daniel Fernandes Year ago

    I like this Command & Conquer feeling every time I watch your videos :)

    • Bruno Oliveira
      Bruno Oliveira Year ago

      Just hopping for her to say: "unable to comply, building in progress"

  • Rambabu verma
    Rambabu verma Year ago

    Can I insert value in list using command line using while loop...........plz provide me this code

    • Rambabu verma
      Rambabu verma Year ago

      As we insert in array in c programing. Is it possible there.

  • Francis
    Francis Year ago

    She deserves a grammy.

  • pravin
    pravin Year ago +4

    "i would have a very, very long list." I am falling for this host! Somebody help me

  • Ben Rawner
    Ben Rawner Year ago

    These are the best Python videos

  • Hugo
    Hugo Year ago


  • mehjebin mujeeb
    mehjebin mujeeb Year ago +23

    I don't think I've ever enjoyed learning so much!!!

    • Socratica
      Socratica  Year ago

      That is so wonderful to hear!! We're so glad you're watching.

  • GEScott71
    GEScott71 Year ago

    Another great tuturial, thanks! I just made a contribution and all of you should too :-)

  • Josip Marić
    Josip Marić Year ago

    freakin awsome video i feel like i'm in some game and after a video when i enter my text editor like i'm in freakin army mission lol.

  • Cerbyo
    Cerbyo Year ago

    reverse(...) method of builtins.list instance
    L.reverse() -- reverse *IN PLACE*
    Okay how the hell does that tell me anything much lesss everything? I type
    reverse(mylistname)....I get an error
    I type L.reverse(mylistname)....I get an error.
    ???????????????????????????? really tells me sooo much. Reverse will REverse *inplace*? Wouldn't a clearer method be "will invert entries" or "will change order making last entry first, first entry last etc"??

    • Cerbyo
      Cerbyo Year ago

      a= list(reversed(primesorwhateverurlistnameis)) will display the list in reverse and allow you to call it up as 'a' instead of typing the whole bit each time u want it displayed reverse since it doesn't apply it straight to ur list. BUT THE FRIGGIN HELP THING DOESN'T TELL YOU ANY OF THAT.

  • Yilmaz Bingol
    Yilmaz Bingol Year ago


  • sharmila rani
    sharmila rani Year ago

    it is so interesting to watch video of u

  • ame7272
    ame7272 Year ago

    You had me at "Order...matters" lol

  • TheBobbyking82
    TheBobbyking82 Year ago

    Great video! I love the whole futuristic look. just sub, hoping to learn python to try to eventually head to C++.

  • ParaDise
    ParaDise Year ago

    Very beautiful video !! I actually learned something !!!

  • Video Collector
    Video Collector Year ago

    I am using Windows10 and I have write some codes to scrape information from a website but I can't copy anything from my command prompt or anaconda prompt. I figure it out that my mouse dosen't working on both command prompt. Can anybody help me?

  • Johny knows
    Johny knows Year ago

    а по русски мона?

  • Tanner Barcelos
    Tanner Barcelos Year ago +8

    Plot twist: this is an AI machine teaching us this.. the coded AI bot is teaching us... to code ? 🤔😂

  • Breath Growth
    Breath Growth Year ago

    Oh her voice really gets my attention, i can finaly probably learn this

  • SuperBror1
    SuperBror1 Year ago

    I'm just a beginner at Python and 11years old, and I understood! Good job!:D

    • pablo ramos
      pablo ramos 6 months ago

      Escape the Minecraft kido, and you'll be free to code an AI army... hehehehehhe

  • 王玮
    王玮 Year ago +1

    One of the best video tutorials ever

  • S Schiavo
    S Schiavo Year ago

    Excellent video - thanks!

  • Alexander Lysberg

    I like to think of slicing as the first unit starting from 0, and the second unit starting from 1. If you have a list of [a. b. c. d. e] and you want the 2:4 slice, you can count a = 0, b = 1 c = 2 (start slice). Then you can count again a = 1, b = 2, c = 3, d = 4 (end slice).
    Because "2 to 4 but not including 4" is such a hassle to say in the head.

  • mrbrockpeters
    mrbrockpeters Year ago +6

    This is my favorite resource for learning Python lately. Short and to the point explanations. I don't use Python enough. In fact, I only seem to use it in the context of working with the Amazon AWS CLI tool.
    Nevertheless, I got a website in PHP that computes does some computations at night. My buddy turned me onto Python when he wrote a sample script that did the job of a PHP script in like a few seconds whereas it took the PHP script like almost 5 minutes to complete. I'm gonna figure out how to port those scripts into Python in my leisure time at night and it's gonna be fun as hell yo! It'll take me some time to figure out but I think it'll pay off later when all those cron jobs are complete faster.
    Step 1. Figure out how to work with Lists.

  • Melinda Sterne
    Melinda Sterne Year ago

    great videos! so informative

  • Ben
    Ben Year ago

    Python is so bizarre not used to a language like this

  • bobby midha
    bobby midha Year ago

    My lists are not maintaining their order. What am I doing wrong?

    • Mr. Nathan Oldridge
      Mr. Nathan Oldridge Year ago

      We believe you are using sets, instead of lists.
      Sets don't have an order, and are declared with { }
      Lists have order, and are declared with [ ]

  • Tech Titans
    Tech Titans Year ago

    Your video was really good. Great explanations. I especially like the fact that you were very clear and detailed with defining #concatenation and one can identify an element that is connected to a particular index. It was really helpful to me that you did not stray off topic by talking about your cat or what you had for lunch or the position of the camera. Sometimes when TheXvidrs do that during an instructional video, it is annoying and distracting. Thanks for the great video! 👍

  • Shadow Gallery
    Shadow Gallery Year ago

    A revolution without dancing is a revolution not worth having.