## Python Tutorial for Beginners 4: Lists, Tuples, and Sets

In this Python Beginner Tutorial, we will begin learning about Lists, Tuples, and Sets in Python. Lists and Tuples allow us to work with sequential data, and Sets allow us to work with unordered unique values. We will go over most of the methods, learn when to use which data type, and also the performance benefits of each type as well. Let’s get started.

The code from this video can be found at:
https://github.com/CoreyMSchafer/code_snippets/tree/master/Python-Lists

Watch the full Python Beginner Series here:

Slicing Video: https://youtu.be/ajrtAuDg3yw

If you enjoy these videos and would like to support my channel, I would greatly appreciate any assistance through my Patreon account:
https://www.patreon.com/coreyms

Or a one-time contribution through PayPal:
https://goo.gl/649HFY

If you would like to see additional ways in which you can support the channel, you can check out my support page:
http://coreyms.com/support/

You can find me on:
My website – http://coreyms.com/
Tumblr – https://www.tumblr.com/blog/mycms

Ivan Stepanoff says:

Hi, dude! You’re brilliant!!! Believe me ’cause I’ve taken many free courses and yours is quick and logical and concentrates much more useful things than the others.

TheTrashcan1999 says:

Amazed by the way you teach. Incredibly good job, keep it up! SUBSCRIBED!

Mohammed waris says:

nice course but I have a problemlikecourses.append(‘Art’)
AttributeError: ‘tuple’ object has no attribute ‘append’

Pi Pi says:

the best online studying python sofar. Thank you very much Corey, I really appriciate!

This is awesome you are a perfect and the best instructor for a python course ever , thank you very much for this course

Saivenkataraju Nanduri says:

def dis(*args):
a=2
If a in args:
Print(‘true’)
li=[1,2,3]
dis(li)

Tonio Music says:

can anyone help me with a sublime registeration key?

srtbasturk says:

This video is saved my huge time thanks

lehman justin says:

This is the best python tutorial set for beginners. Thank you so much.

Punit Sharma says:

Python 3 ?????

Mohammed waris says:

courses.append(‘Art’)
AttributeError: ‘tuple’ object has no attribute ‘append’

Sandesh Darlami says:

very clear. and direct to the point. its very easy to understand thanks keep uploading

Shuhao Lu says:

what program is he using? Seems like a better program than python shell itself!

Nnamdi Azodo says:

Thank you for this! You make learning Python easier for me. God bless you

De Kift says:

Thanks Corey, great tutorials! Very clearly layed out and nice presentation.

There’s one thing here that struck me: I’m not new to programming in general but the behavior in 21:28 ( _both_ lists changing) was quite shocking to me I had a slight hunch what was happening there but still I had to look it up and found this: https://stackoverflow.com/questions/2612802/how-to-clone-or-copy-a-list (for all you guys out there who got confused).

npgatech says:

Hi Corey, love your tutorials but please explain **WHY** we need to use tuples vs. lists. Saying that use tuples when you need immutable values and use lists when you need mutable values is not sufficient. One of the things that irk me so much about every single tutorial, book, lesson on programming is no one fricking explains **why**. You did explain why when you were explaining sets – i.e. they are more efficient when doing certain operations (union, difference, intersection). Similarly, tuples are immutable, but they more efficient for lookup than lists. That is why you use tuples. Thanks for listening You’re probably the best teacher on Python anywhere on the internet. Thank you!

Michelle wooltorton says:

Just started to learn Python this tutorial is easy to follow and has helped me to understand loads thank you so much.

Azhagu Nagappan says:

By far many Python tutorials are available in the internet,Like Coursera python courses, Udemy, Learning python the hard way, many other blogs and Vlogpresented by many individuals and companies, with all due respect to all the tutorials given by Corey Schafer is simple and to the point. Anyone willing to learn Python(programming) going through Corey Schafer’s tutorials will give you happiness. Thank you Schafer!.

Hassan Rashid says:

How do you select + copy a word and then select current word + paste copied word using keyboard shortcuts?

Barkie Berkan says:

Verry usefull video Thanks!

BaBu Aravind Vennu says:

Love your confidence, Adds up to my grasp of the subject while watching the videos.

darin khath says:

Hi Corey, is this a complete tutorial series or are you still adding more material to this playlist / tutorial videos.

Dor Solomon says:

Python Equivalent of Java hashmap?

Louie John Seno says:

The best !

Little Midget says:

What text editor are you using in this video?

Samuel Kampa says:

Superb video. Excellent pacing!

This is super helpful, thank you very much

Rajani Mandlecha says:

videos are very helpful. Thank you.

somenath ghosh says:

Hi Corey! you are just awesome !!! great vidoes.
my_list1 = [‘c’,’d’,’e’]
my_list2 = [‘a’,’b’]

How we can join them together so that final_list would be like this
final_list = [a’,’b’,’c’,’d’,’e’]

your videos are just amazing for beginners, i am really thankful for your efforts .

Awaleh Houssein says:

You’ve done a great job, thank u so much.

Prateek Dave says:

How are List , Tuple and Sets implemented to be what they are ?

Jeef TechTips says:

This is not correct where you said if change one string in tuples also change the second string for second list. The reason it happens in your code is because your second list = to the first list.

Swarnabh Kashyap says:

Thank you Corey! You are awesome!

Hello, I am really happy with the videos, thank you so much. I have a small question.When I perform enumerate on a list and print the original list it is only printing the last element in the list may I know why is that?
Thank you

Jason Rims says:

hey Corey. Why is my cancel Build greyed out and cant work. I cant cancel build like you did at 12:14

Farhanking7862 says:

These videos helped me understand python so much easier than my textbook! thanks

SACHIN DIMRI says:

thank’s brother
your videos are worth time spending..

Tonio Music says:

Marcin Milejski says:

I think this is easy question but painful for me to find the answer.
when you created nums list u made automatic space after , How!?

Vipul Rana says:

Awesome work, I had a question when I entered nums=[’99’,’11’,’0′,’9′] the output was [’99’, ‘9’, ’11’, ‘0’] for nums.sort(reverse=True) and [‘0′, ’11’, ‘9’, ’99’] for nums.sort()

It is the best tutorial I have ever watched.

William Spicer says:

Awesome material! I enjoy the way you present the information and give demonstrations. I come from a C# background,but I figured I should take on some Python as well. I definitely enjoy watching your videos, keep it up!

NABIL MH says:

thank you

sumitkumar rai says:

can you please make a video for quick sort in python??