Python 101: Learn These MUST KNOW List Features

Tech With Tim · Beginner ·💻 AI-Assisted Coding ·2y ago

Key Takeaways

The video covers the basics of Python lists, including indexing, negative indexing, slicing, zipping, and list comprehensions, with a focus on must-know features for beginners.

Full Transcript

do you know what the result of this python code is give it a shot pause the video and leave a comment with your answer now if you had any trouble coming up with that answer or you haven't seen this syntax before make sure you watch this whole video where I walk you through all of the must know python list features let's start by defining a list a list in Python is an ordered collection of elements now we can store any elements that we want they don't have to be the same data type they can be different ones in this case I have a list that has five elements and these are simp simply strings but if I wanted to I could mix and match and I could put true in here I could put a number doesn't matter the data types do not need to be the same Now list are mutable meaning once they're created they can be changed and every position in the list has something known as an index that means that I can actually access and change what exists at each position in this list by knowing the index now when we start indexing let's just write this out here we index at zero and then one and then two and then three and then four so we go up by one every single time the first index is always zero and the last index is whatever the length of the list is minus one in this case we have five elements in our list when we subtract one we get four so that's the last index now if we want to use the indexes we can do something like this LST at index zero if I decide to print this out that is going to access for me the first element let's have a look here I got to run this again and you see that we have a now if I put index 4 that will give us the last element which is Element e or string e now as well as accessing we can modify by the index so if I said LSD Z is equal to some big number like this and then I go ahead and print LST and run my code you see that now we've actually modified the list and changed it and replaced a with this large number great that's the basics on indexing now as well as indexing from the beginning of the list we can index from the end of the list so check this out we actually have -5 -4 if we can type this correctly -3 -2 And1 as valid indexes relative to the end of the list so to grab the last element we use 1 second last element -2 third last element -3 so on and so forth so now if I were to print LST at5 clear and run you see that we get a because that's the fifth last element from the end of the list now the reason negative indexes can be useful is because in other languages what you typically have to write if you wanted to access the last element in the list is something like LST and then the length of the list this is how you get in Python by the way Len and then you surround the object in this case it's LST minus one so you can see this is a little bit more verbose it's kind of more difficult to read so instead in Python we just do negative 1 and that always gives us the last element in the list now we'll get into a bunch of other list features in a second but I want to quickly mention I just released a massive software development course the goal of this course is that everyone that graduates actually gets a job the way that we're supporting that is we actually have an employer portal where once you graduate and you go through our proctored final exam and all the projects that we have you'll show up in that employer database and employers will actually pay us money to interview you because we've already vetted you you've gone through an intense curriculum you know everything to be the best possible Junior developer you can be in both front end backend and devops now you can pick the specialization you want to go into and those specializations are taught by industry experts that are not myself so you have a front end expert devops expert and backend expert where I teach you all the fundamental skills so that you actually understand what specialization you want to choose anyways you guys can check it out from the link in the description now let's get back into our list now that we've looked at that let's see how we can actually add remove and insert elements from list if we want to add something to our list so actually a new element not replacing an existing element we can use the the do append method now if I append something like five this will simply go to the end of the list so if I run my code here we should print out the list so we can see it you will see that we get AB bcde e and then five that's how you append now what if you want to remove well if we want to remove from our list we can use this pop function now what this pop function does is actually remove and return the element at the end of the list in this case it's going to be e so if I print out remove and LST and I clear and run you see we get e and then the rest of the list except we no longer have e because we popped it or removed it now with the pop method we can actually specify the index at which we want to remove so let's say we want to remove C I can put two here which is the index of c and when I run this now I get a b no C and then d and e and C gets stored in this variable because that's what pop does now let's say we don't actually know the index of the element we want to remove if that's the case we can remove the element based on its value by using using the remove function so if I wanted to remove B I would do LST do remove and not n this is B and if I clear and run you see we get a c d e now an important thing to keep in mind with this method is it removes the first instance of that element so if I have two B's here you'll see that we only remove the first B we don't remove the last one so you need to run this method multiple times if you want to remove all of the different instances Also let's see what happens if we try to remove an element that doesn't exist I go here and run and notice we get an error because that element doesn't exist so you need to actually know that the element exists before you remove it I'll show you how you can find that in a second all right so a few last methods related to insertion or kind of adding or modifying the list we have an insert method this insert method will insert an element at whatever index you specify so let's say I do index 2 which is currently where C is and I insert some big number well now when I run my code notice I get a b and then I index to this new new element and the rest of the elements get shifted over to the right in the list that's great now one other thing to show you here let's see what happens if I append another list so maybe I have a list that has the elements one two well if I clear and run here notice that this actually gets added as its own element so the last index is specifying this list this is known as nesting list we'll look at that in a second sometimes though you don't actually want this Behavior you want to take both one and two and you want to put them in the list as individual elements if that's the case you can use this extend function now the extend function will take all of the elements in the iterable object that you specify in this case it's a list and add them as individual elements in the list so if I run this notice we get a bcde e b and then one and two which are the elements that existed inside of this list now that we've discussed that I want to talk about something known as mutability now lists are mutable that means we can modify them once they've been created now this is in contrast to immutable objects like a tupple so so in Python we have tuples these are using regular parentheses and you'll notice that if I go to my tupple and I do something like topple at index zero is equal to 100 and I run my code we actually get an error and it says tble object does not support item assignment that's because this is immutable once I create it I cannot modify it if I want to make a change to this I need to make a new tupple object that has that change that's different than lists lists we can actually modify in place and this gives them some special behavior so now let's what happens if I do something like this lst2 is equal to LST and we'll say lst2 at index0 is equal to 100 and then we'll print both our lists now you'll notice when I clear and run here that we actually get the exact same list even though we only made the change to list two now the reason that happens is because this is a mutable object whenever you store mutable objects you're actually storing a reference to them so when I say LST is equal to this list I'm creating a new list and referencing that list that means when I have lst2 is equal to LST I'm actually just copying the reference to this list into another variable so whenever I make a change to LST it affects lst2 whenever I make a change to lst2 it affects LST because these are referencing the same underlying list so you need to keep that in mind if you want to copy a list you actually need to do that in a special way what we're doing right here is just creating another reference refence or something known as an alias to the same list now this becomes especially important when you start using lists as function parameters so for example let's I have a function defined funk I take in some LST and I just say LST 0 is equal to 100 well now I can make I don't know new list here is equal to 1 2 3 and I can actually call my function on new LST and then print my new LST and you'll see that just like before we actually modify that list in place that's because again when we pass this value here to the parameter we're storing the reference to this list so we can actually modify a variable outside of the function because it's mutable very important to understand you need to know this to be able to use lists effectively okay so beyond that we have nesting of lists and we saw this briefly before but we can store lists inside of other lists so if I have LST is equal to a list like this I can actually store other list this and I can use kind of a double indexing method which you're going to see here in a second so let's say I want to access and we should really change this the value four well to access the value four I first need to access the list that stores four so I can print list at index one and I'm going to access this second list and you see that we get 3 four now that I have that list I can index it again and I can grab the second position or the first index of that list and that will give me the value four now this keeps going into Infinity like if I had another list here right now when I do one one you see that I actually get the list for so then I would have to access index0 here to be able to grab the actual value for that's nesting just quickly wanted to show that to you now that we've looked at nesting let's look at the most common issue I see with python list and this is using list as default parameters so let's say again I have my function and I have LST equal to a default parameter of say one two now maybe what I'll do inside of here is I will just say LST do append 100 and I will return my list so this is a simple function all it does is it just takes some list it appends 100 to it and then it returns that list but what it has is a default value for its parameter that means I can call this function without passing in my own list and it will use the list right here which has the value one two so we're going to say lst1 is equal to Funk and lst2 is equal to Funk and LST 3 is equal to Funk we're just going to print all of these out and take a guess yourself what you think the output is going to be I've kind of hinted uh as to what's going to happen but pause the video take a guess and then I'm going to run the code okay so let's run our code here and notice that our lists continue to get larger and larger and in fact they're actually the same list this is a little bit weird what's happening well what's going on here is we have a default parameter which is a mutable list now that means that when I make a change so I do LST do append 100 I'm actually modifying this default parameter so every time I call function I'm appending 100 into this list and all of list one two and three have the same list that they're referencing cuz I'm returning a reference to this list which is a mutable object I know it seems a little bit confusing here but the kind of moral the story is don't use a list as a default parameter in fact don't use anything mutable as a default parameter unless you're going to be copying it and even then you probably don't want to do that so just as a quick demo here if I pass in my own list now so I'm passing three distinct lists here okay and I run you'll notice that we get what we expect 100 in each list okay whereas if I do something like a is equal to this and then I pass a here okay so a a and a you'll notice that we get the exact same list three times again because we're appending to a every single time because this is a mutable object now that we've got into that let's talk about slicing which is one of my favorite features of list now a slice is essentially like a for Loop in Python but for iterating or grabbing values out of a list so if I have my list like 1 2 3 4 five we'll just use numbers to keep it nice and simple here I can actually create a slice of this list so I can say print LST I can do my square bracket syntax and now I have the ability to use up to two colons now bear with me here there's a few things that you need to remember so first of all I can use one colon now when I use one colon right here what this actually does is create a copy of the list we're going to look at that in one second I promise now the first kind of thing to the left of the colon so the left of the colon here when you don't put anything there that indicates to start at the beginning of the list when you don't put anything to the right of the colon that indicates to go to the end of the list including the last element so if I just print out the list here with one colon this is actually valid syntax and you see we just get the exact same list now though if I do something like one colon what I'm actually specifying is I want to start at index one and I want to go to the end of the list including the last value when I run it now notice I get from two to the end of the list now let's do one colon and then index 6 what I'm doing now is specifying I want to start at index one and I want to go up to but not include index six now index 6 is seven so that means I'm going to have a list which is 2 to six and that's exactly what I get okay so you have your start colon and then your stop if you leave them empty the start is going to be the beginning of the list and the end is going to be the end of the list and it's going to include that last value now where things get a bit more complicated is when we have two colons now when we have two colons we actually go start stop step so I can do something like one six here and if I leave this step empty by default I'm going to have a step of one so I get the exact same list but if I put a two here I'm actually specifying that I want to step over every second element so now when I run my code I get 2 46 so I skip every second element this is similar to a for Loop where you set I equal to some value you go up to some value and then you increment by some step in this case the step we're using is two now slices can get pretty complicated and you can actually use negative values in slices so let's say I have a colon and then I do1 well what do you think we're going to get here let's run this and notice that we actually get the entire list minus the last element because we go up to everything but the last element whereas if I put a Nega -1 here as my start you'll see that we just get the last element in this list of the slice now one little trick you can use is you can actually step negative so I can do colon colon negative 1 now this is actually a very fast way to reverse list in Python when I do this you'll actually see that we get the entire list reversed okay we're starting at the beginning going to the end but stepping negative 1 so stepping backwards which kind of goes circularly I won't really explain this much more in depth but negative or colon colon neg1 will reverse the list for you okay you can do all kinds of interesting things here with a slice now just as a last example here with our slice we can actually modify segments of a slice so let's say I do something like 2 colon 4 I can actually make this equal to a list with just one element inside when I run my code now if I print out LST you'll see that what I've done here is I've inserted one in position of the slice from 2 to 4 now to make this more clear we can do like a th a th000 and you'll see that I've essentially replaced what happens in this slice with whatever I put here so now we're going to go through some of the more useful methods that you can use on list first of all I want to show you how you can determine if something is inside of a list to do that we can say contains is equal to and then something like two in LST now this in operator simply tells us if whatever the value is on the left hand side is contained inside of the iterable in this case it's a list so if I print contains you can see that we get true indicating that two does indeed exist now let's say that you don't know what elements are inside of the list and you first want to check if something exists inside the list okay I found two it exists maybe now what I want want is the index of value two well what I can do now is actually grab the index by using the index method I can say LST do index and then two and now I can bring contains and index and it will tell me the index of element two which is one now a few other useful methods we can use are the count method so for example I can go here and say print LST do count and I can count three and if I clear and run you see that it tells me we have two instances of three in inside of the list now as well as those we can also sort our list so I can say LST do sort now what this is going to do is perform an inplace sort that means it's actually going to modify the list change all of the elements to be in the correct position so this is kind of interesting if I print out LST do sort you'll actually see that we get none the reason we get none is because this method doesn't return anything it actually just sorts the list for us so if I do another print statement here and now I print LST okay you can see that now we get the list in ascending order now we can also specify if we want it in descending order I believe we can say descend is equal to True uh I think that's the correct oh no sorry it's reverse equals true okay reverse equals true if we do that now it's going to sort it in descending order so we get from eight all the way down to one so that is sorting now as well as sorting we can actually reverse a list so same thing here I can say list. reverse now again this is going to happen in place so notice it returns none and reverses the list for us now as well as those sort and reverse methods we also have functions that will do this that actually return new objects to us so what I can do is actually wrap my list here in sorted and now if I print out sorted and then I print my list like this you'll notice that it actually doesn't modify my original List It returns a new list which is the sorted version of this list so very interesting to see that now as well as sorted we have reversed same thing and we'll return a new instance that does not modify the list in place now this is giving us something known as an iterator if we wanted to convert this to an actual list we would just wrap this in list not going to dive into that too much okay beyond that I did promise you I was going to show you how to make a copy of a list few ways to do this but the most common is to use the slice operation so I can say list 2 is equal to LST and then simply do a single colon now if I do LST at zero is equal to a big number and then I print my list and my list two you'll see that these are now different lists because we made a copy of the original list so notice we've only modified list two we did not modify list one because we made a copy here using the slice operator all right so one more cool thing to show you here is something known as the zip function let's say we have two lists here names and ages and they actually have corresponding indices right so the ages at index zero correspond with the name at index zero well we can actually use a function called zip so I can zip these together let me just say zipped if I can fix my cap locks here what is going on caps okay zipped is equal to zip and then I can pass my names and my ages and it'll actually create topples for us of all of the matching indices so if I go ahead and print the list of my zipped and I go here and run this you see that we actually get tles with the corresponding indices you can do this with as many different lists as you want so we can zip three four 5 100 lists and the reason why I put a list here is because this actually returns an iterator for us an iterator is something that we can Loop over but if we want to get all of the values in just a human readable form we do have to convert it to a list so now that we've looked at zip last really cool thing to show you here is list comprehensions you've probably seen this before but this is one of the coolest parts of python where what I can do is write a list and I can actually populate the list by using something known as a comprehension so I can do something like X forx in range 10 now if I go here and print out my list you will will see that when I run this I get 0 through 9 now I can even make this a bit cooler I can say x for X in range 10 if xod 2 is equal to zero now this is just going to give me all the even numbers including zero I could go much further into how to do this you can also have list comprehensions of list comprehensions so I can actually just make this like that and this isn't going to be that useful let's take this so x for X there 4ore in range 5 now it's a bit difficult to read this let's zoom out a little bit what this is going to do for us is give us a list of even numbers five times so now when I run this you can see we get a nested list comprehension the syntax is like I have here you kind of can pause and parse it and see exactly how it works but I don't want to make the video too long here and continue going on about this anyways really cool you can do list comprehensions and you can write all kinds of wild syntax in Python if you want to learn more you should subscribe to my channel because I have a lot more python content anyways I'm going to wrap it up here if you guys enjoyed leave a like subscribe and I will see you in the next [Music] one

Original Description

To learn programming and Python - check out Datacamp! 💻 Learn Python - https://datacamp.pxf.io/Vmze3M 💻 Learn Programming - https://datacamp.pxf.io/B0mJoW In this video i'm going to walk you through all of the must-know Python 'list' features. What is a list? A list in python is an ordered collection of elements. We can store any elements we want in a list regardless of the data type. We will go over everything from Indexing, Negative indexing, Slicing, & Zipping. Check out my FREE introduction to Software Development course to learn how to break into tech and make $80k+/year! https://techwithtim.net/dev 🎞 *Video Resources* ⏳ *Timestamps* 00:00 | List Challenge 00:16 | What is a List? 00:42 | Indexing 01:55 | Negative Indexing 02:56 | Become a Software Developer 03:50 | Adding, Removing, & Inserting 06:50 | Mutability 09:20 | Nested Lists 10:13 | Slicing [start : stop : step] 16:25 | Useful List Methods 19:41 | Zipping Lists 20:39 | List Comprehensions 🔗 *Socials* 📸 _Instagram_ https://www.instagram.com/tech_with_tim 🐦 _Twitter_ https://twitter.com/TechWithTimm 💬 _Discord_ https://discord.gg/twt 🤝 _LinkedIn_ https://www.linkedin.com/in/tim-ruscica-82631b179/ 🌐 _Website_ https://techwithtim.net 💾 _GitHub_ https://github.com/techwithtim *Support* 👕 _Merch_ https://teespring.com/stores/tech-with-tim-merch-shop 💵 _Donations_ https://www.paypal.com/donate?hosted_button_id=CU9FV329ADNT8 🙏 _Patreon_ https://www.patreon.com/techwithtim 🔖 *Tags* - Tech with Tim - How to Code - Python List *Hashtags* #software #computer #python
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Tech With Tim · Tech With Tim · 0 of 60

← Previous Next →
1 A* Path Finding Algorithm(Visualization)
A* Path Finding Algorithm(Visualization)
Tech With Tim
2 Python Programming Tutorial #1 - Variables and Data Types
Python Programming Tutorial #1 - Variables and Data Types
Tech With Tim
3 Python Programming Tutorial #2 - Basic Operators and Input
Python Programming Tutorial #2 - Basic Operators and Input
Tech With Tim
4 Python Programming Tutorial #3 - Conditions
Python Programming Tutorial #3 - Conditions
Tech With Tim
5 Python Programming Tutorial #4 - IF/ELIF/ELSE
Python Programming Tutorial #4 - IF/ELIF/ELSE
Tech With Tim
6 Python Programming Tutorial #5 - Chained Conditionals and Nested Statements
Python Programming Tutorial #5 - Chained Conditionals and Nested Statements
Tech With Tim
7 Python Programming Tutorial #6 - For Loops
Python Programming Tutorial #6 - For Loops
Tech With Tim
8 Python Programming Tutorial #7 - While Loops
Python Programming Tutorial #7 - While Loops
Tech With Tim
9 Python Programming Tutorial #8 - Lists and Tuples
Python Programming Tutorial #8 - Lists and Tuples
Tech With Tim
10 Python Programming Tutorial #9 - Iteration by Item (For Loops Continued...)
Python Programming Tutorial #9 - Iteration by Item (For Loops Continued...)
Tech With Tim
11 Python Programming Tutorial #10 - String Methods
Python Programming Tutorial #10 - String Methods
Tech With Tim
12 How to Overclock a NVIDIA GPU
How to Overclock a NVIDIA GPU
Tech With Tim
13 Python Programming Tutorial #11 - Slice Operator
Python Programming Tutorial #11 - Slice Operator
Tech With Tim
14 Python Programming Tutorial #12 - Functions
Python Programming Tutorial #12 - Functions
Tech With Tim
15 Python Programming Tutorial #13 - How to Read a Text File
Python Programming Tutorial #13 - How to Read a Text File
Tech With Tim
16 Python Programming Tutorial #14 - Writing to a Text File
Python Programming Tutorial #14 - Writing to a Text File
Tech With Tim
17 Python Programming Tutorial #15 - Using .count() and .find()
Python Programming Tutorial #15 - Using .count() and .find()
Tech With Tim
18 Python Programming Tutorial #16 - Introduction to Modular Programming
Python Programming Tutorial #16 - Introduction to Modular Programming
Tech With Tim
19 Python Programming Tutorial #17 - Optional Parameters
Python Programming Tutorial #17 - Optional Parameters
Tech With Tim
20 Python Programming Tutorial #18 - Try and Except (Python Error Handling)
Python Programming Tutorial #18 - Try and Except (Python Error Handling)
Tech With Tim
21 Python Programming Tutorial #19 - Global vs Local Variables
Python Programming Tutorial #19 - Global vs Local Variables
Tech With Tim
22 Python Programming Tutorial #20 - Classes and Objects
Python Programming Tutorial #20 - Classes and Objects
Tech With Tim
23 Cool VBS Script to Prank Your Friends!
Cool VBS Script to Prank Your Friends!
Tech With Tim
24 How to Overclock an AMD GPU
How to Overclock an AMD GPU
Tech With Tim
25 Best GPU'S For Mining Ethereum (2018)
Best GPU'S For Mining Ethereum (2018)
Tech With Tim
26 Recursion and Memoization Tutorial Python
Recursion and Memoization Tutorial Python
Tech With Tim
27 Ethereum Mining Rig - Hardware Guide
Ethereum Mining Rig - Hardware Guide
Tech With Tim
28 Pygame Tutorial #1 - Basic Movement and Key Presses
Pygame Tutorial #1 - Basic Movement and Key Presses
Tech With Tim
29 How to Install Pygame (Windows 8/10)
How to Install Pygame (Windows 8/10)
Tech With Tim
30 How to Trade Your Cryptocurrency (Bitcoin, Ethereum etc.) For Cash!
How to Trade Your Cryptocurrency (Bitcoin, Ethereum etc.) For Cash!
Tech With Tim
31 How to Mine Ethereum 2018 - WORKING (Super-Easy)
How to Mine Ethereum 2018 - WORKING (Super-Easy)
Tech With Tim
32 Microphone Comparison - $10 Mic vs $150 Mic (Blue Yeti USB)
Microphone Comparison - $10 Mic vs $150 Mic (Blue Yeti USB)
Tech With Tim
33 Pygame Tutorial #2 - Jumping and Boundaries
Pygame Tutorial #2 - Jumping and Boundaries
Tech With Tim
34 Pygame Tutorial #3 - Character Animation & Sprites
Pygame Tutorial #3 - Character Animation & Sprites
Tech With Tim
35 Pygame Tutorial #4 - Optimization & OOP
Pygame Tutorial #4 - Optimization & OOP
Tech With Tim
36 OBS Studio Tutorial - Best OBS Settings
OBS Studio Tutorial - Best OBS Settings
Tech With Tim
37 Linear Search Algorithm - Python Example and Code
Linear Search Algorithm - Python Example and Code
Tech With Tim
38 Make Any Mic Sound AMAZING! (WITH OBS)
Make Any Mic Sound AMAZING! (WITH OBS)
Tech With Tim
39 Binary Search Algorithm - Python Example & Code
Binary Search Algorithm - Python Example & Code
Tech With Tim
40 Pygame Tutorial #5 - Projectiles
Pygame Tutorial #5 - Projectiles
Tech With Tim
41 Pygame Game - Mini Golf
Pygame Game - Mini Golf
Tech With Tim
42 Pygame Tutorial - Projectile Motion (Part 1)
Pygame Tutorial - Projectile Motion (Part 1)
Tech With Tim
43 Pygame Tutorial - Projectile Motion (Part 2)
Pygame Tutorial - Projectile Motion (Part 2)
Tech With Tim
44 Pygame Tutorial #6 - Enemies
Pygame Tutorial #6 - Enemies
Tech With Tim
45 Pygame Tutorial #7 - Collision and Hit Boxes
Pygame Tutorial #7 - Collision and Hit Boxes
Tech With Tim
46 Pygame Tutorial #8 - Scoring and Health Bars
Pygame Tutorial #8 - Scoring and Health Bars
Tech With Tim
47 Cloud Mining vs. Hardware Mining - 2018
Cloud Mining vs. Hardware Mining - 2018
Tech With Tim
48 How to Install Pygame on Mac OSX (Fast-Simple)
How to Install Pygame on Mac OSX (Fast-Simple)
Tech With Tim
49 Pygame Tutorial #9 - Sound Effects, Music & More Collision
Pygame Tutorial #9 - Sound Effects, Music & More Collision
Tech With Tim
50 Pygame Tutorial #10 - Finishing Touches & Next Steps
Pygame Tutorial #10 - Finishing Touches & Next Steps
Tech With Tim
51 How to Fade Your Screen in Pygame [CODE IN DESCRIPTION]
How to Fade Your Screen in Pygame [CODE IN DESCRIPTION]
Tech With Tim
52 How to Create a Button in Pygame [CODE IN DESCRIPTION]
How to Create a Button in Pygame [CODE IN DESCRIPTION]
Tech With Tim
53 Pygame Side-Scroller Tutorial #1 - Scrolling Background/Character Movement
Pygame Side-Scroller Tutorial #1 - Scrolling Background/Character Movement
Tech With Tim
54 Pygame Side-Scroller Tutorial #2 - Random Object Generation
Pygame Side-Scroller Tutorial #2 - Random Object Generation
Tech With Tim
55 Pygame Side-Scroller Tutorial #3 - Collision
Pygame Side-Scroller Tutorial #3 - Collision
Tech With Tim
56 Pygame Side-Scroller Tutorial #4 - Scoring and End Screen
Pygame Side-Scroller Tutorial #4 - Scoring and End Screen
Tech With Tim
57 How to Create A Message Box in Python - Tkinter
How to Create A Message Box in Python - Tkinter
Tech With Tim
58 Is Ethereum Mining Still Profitable - Is It Worth It (April 2018)
Is Ethereum Mining Still Profitable - Is It Worth It (April 2018)
Tech With Tim
59 How to Run MAC OSX on a WINDOWS PC (Clover Boot-loader)
How to Run MAC OSX on a WINDOWS PC (Clover Boot-loader)
Tech With Tim
60 Programming Problem #1 - Alphabet Soup (Beginner/Novice)
Programming Problem #1 - Alphabet Soup (Beginner/Novice)
Tech With Tim

This video teaches the basics of Python lists, including indexing, slicing, and zipping, and provides a comprehensive overview of list operations for beginners. By watching this video, viewers can learn how to work with lists in Python and improve their coding skills.

Key Takeaways
  1. Create a Python list
  2. Index into a list
  3. Use negative indexing
  4. Slice a list
  5. Zip two lists together
  6. Use list comprehensions
💡 Lists are a fundamental data structure in Python, and understanding how to work with them is crucial for any Python programmer.

Related Reads

📰
You Feel 20% Faster. A Study Says 19% Slower.
Developers using AI tools may feel 20% faster but are actually 19% slower, highlighting the importance of reviewing code for bugs
Dev.to AI
📰
Fable's judgement
Learn to leverage Fable's judgement for efficient testing and development workflows
Simon Willison's Blog
📰
my AI-code language is now honest all the way down to WebAssembly
Learn how LOOM, a compact experimental programming language, achieves honesty all the way down to WebAssembly, enabling transparent and trustworthy code execution
Dev.to · umbra
📰
my AI-code language is now honest all the way down to WebAssembly
Learn how LOOM, a compact experimental programming language, achieves honesty all the way down to WebAssembly, and why this matters for AI-code development
Dev.to · umbra

Chapters (12)

| List Challenge
0:16 | What is a List?
0:42 | Indexing
1:55 | Negative Indexing
2:56 | Become a Software Developer
3:50 | Adding, Removing, & Inserting
6:50 | Mutability
9:20 | Nested Lists
10:13 | Slicing [start : stop : step]
16:25 | Useful List Methods
19:41 | Zipping Lists
20:39 | List Comprehensions
Up next
How to Create Presentations in Microsoft Cowork (Copilot) with Templafy MCP
Templafy
Watch →