what is a List in Python?
Skills:
LLM Foundations85%
Key Takeaways
The video covers the basics of Python lists, including creation, modification, indexing, and negative indexing, using tools such as square brackets and the print function.
Full Transcript
this is a python list and they are ridiculously powerful and pretty fun to play with so in this episode get your copy ready because we're covering the what and why of this incredible data structure and how it will open up a whole new world of python goodness you ready let's dive in [Music] okay here we go one more sip of coffee let's get started so we covered a variable we create it assign it a simple piece of data and we can use it everywhere in our python script it's awesome but let me show you when it's not awesome because you and i we're going on a camping trip what you didn't know yeah come on but first we need our python lab up and running let's get that running real quick so check that link below in the description to get access to a free python right now now while your lab is loading up let me tell you about the sponsor of this entire series and why it can be free here on youtube it pro tv they are by far my favorite it training provider they are what i use to keep myself up to date on all the latest things in it from automation which come look at all these automation things to all things cisco holy crap like all the cisco stuff encore devnet ccna and of course python they have everything you need to go crazy in python right now if you just cannot wait and you want to go further this is it seriously check it out link below but that's not all that's like an infomercial but seriously they do have more than training they have hey look practice test to get you ready for those crazy exams or how about a lab to actually practice what you're doing look at all these labs so if you want to learn it like me check it out link below use code network chuck and get 30 off forever seriously they are awesome so yeah your lab should be up and loaded let's keep going so we're going on a cappy trip and like all campy trips we need a ton of stuff 10 sleeping bags raspberry pies flash drives ethernet cables marshmallows just things like that right the essentials now here's what i need you to do i need you to create a variable let's name it camp underscore stuff and i want that to equal all the supplies we have to bring go ahead and do it right now in fact we'll we'll do it together right now let's do it so using the knowledge we learned so far in this series we might do this camping stuff variable created let's have it equal something equals and you know we'll just start typing in the stuff 10 sleeping bags jump forward in time and have it already there and if we print the variable camping stuff and we run our code go and click around at the top there that works but it doesn't because right now this is one big fat gargantua string it's bloated it's ugly i hate it it's really hard to use and honestly kind of stupid we can do better instead of storing all of our data into one big fat string we can try out something really cool something amazing something fun something life changing something called a python list let's do this which honestly makes total sense because we're trying to make a list of things we got to bring hey python list it just it just all adds up it's all coming together here so i'm going to create a new variable called camping underscore list just like before but here comes the craziness don't worry i'll walk you through it brackets that's the game changer right there buckle your seat belt coffee break and time to build the list you can step forward in time just go ahead and jump jump forward in time done that was exhausting need a coffee break okay and also i want you to do the same thing so i know it's a lot of typing whatever just just do it it's not too hard now this right here is a python list and it's so awesome for so many reasons way better than this idiot over here and i will go into why but first let's get a really nerdy definition on what a python list is go ahead bernard a python list is an ordered and changeable collection of data objects unlike an array which can contain objects of a single type a list can contain a mixture of objects now first before we talk about how awesome this is i want you to print the type of data this camping list variable is just go ahead and print it real quick the type do you remember how here's how we do it print using our print function and then in the print function we use our type function and i'll just print the type of the camping list because i don't want to lie to you i got to prove to you that this is a data structure called list let's go and run the code run and there it is suckers i told you a data class a data structure called list oh man i'm telling you this is going to open up so many doors to python coding we're gonna spend a lot of time like actually playing with this okay anyways i'm excited for you let's keep going i'm gonna delete the stuff real quick and we'll talk about what the junk is going on with this stuff up here now you can recognize a list because it'll always have opening and closing brackets bam and bam it has to have those that's what a list needs and then inside that list is where we have our data and notice how the data is separated by a comma there they all are now real quick let's bask in the awesomeness of a list so up here right is a big ugly strings one big fat string down here we got a bunch of individual strings like how many we have here count for me i'll do it we have 10 individual pieces of data inside this one variable so much better right you're probably thinking well why is it so much better we'll get to it we'll get to i'll show you a use case here but can i tell you something else cool about a list it can have more than just string data types inside of it let's try it out actually so let's create a new list and i want to name this camp underscore site and actually you know i want you to do this and here's the data i want you to put in there it'll be like campsite information first the name of our camp will be or the campsite will be crystal lake sounds perfectly safe and then of course we'll need our site number which will be 404 and then they expect a temperature of that day it's going to be a balmy 89.3 degrees and then one more piece of data is this place dangerous true or false um it's going to be true it is dangerous so make our campsite list go for it now pause on pause coffee break let's go ahead and do it to make our list we'll do an opening bracket and our amazing python replit here will make it for us first data crystal lake is a string cool we got that comma space you space is optional but it's best practice do a space just because it looks prettier and we're all about pretty next piece of data 404 that's going to be a number an integer right done just like that no quotes space comma space temperature 89.3 degrees fahrenheit people i'm i'm in america get over it and then finally is it dangerous yeah true cool so how amazing is this here in this list we have four different types of data right we got a string we have an integer a float and a boolean i don't know why i say it like that i'm sorry so now i think you're starting to see how amazing the lists are they can hold multiple pieces of data and different types of data doesn't that make you just a little bit excited if it doesn't man sip some more coffee and then come back to me okay rewind now here comes the killer killer the killer part of list i i talked about this if you remember what professor bernard said they are ordered what does that mean i'll explain it by showing you two amazing things you ready for this okay here we go let's say that out of our camping list i need to assign who's going to bring what on the camping trip so for example me i'm going to bring coffee duh right you saw that coming and you you're coming right yeah you're coming you're gonna bring marshmallows because they're delicious here's how i can assign that data with a list oh it's so powerful watch this this is gonna blow your mind i'll create the variable me and have that equal watch this the list camping list and then do some brackets and then in those brackets i'm going to put the number four what just happened what am i doing watch i'm going to print me the variable me let's run it run did you see that sorry i know it seems like i'm over exaggerating but i'm really this excited about it i'm not kidding right here it printed just coffee just that one string that one piece of data in our list now go ahead and do the same thing for you do you remember what you're bringing go ahead and do it real quick pause the video do the same thing for you and then print out that one item go unpause okay how would you do that create the variable u have that equal camping list and then brackets let's see if you could figure this out you were bringing marshmallows which is the last in our list which means marshmallows will be nine did you get that right i'll explain why it's nine in here in a second but let's go and print it out i'll put it below me printing younow and run coffee and marshmallows yes so when i say the list is ordered or you might see people talking about it being in a in a sequence or sequenced when you put your stuff that data into your list the order you put it in there it stays the same which is great because we can do things like reference the individual items in that list so when it says ordered when it says sequence it just means hey that stuff you put in there it's in that same order all the time unless we change it which we'll talk about later but then real quick hold on why was coffee four because if we're looking at our list here we got one two three and then four raspberry pi is four coffee should have been five right no we're dealing with computers and computers have to be difficult sometimes you might realize and remember and know that computers always start counting with zero so what they do so test would be zero then one two three bringing us at four with coffee which is why marshmallows instead of being ten would actually be nine so in an a list with ten items your last number will always end up being nine just keep that in mind that that always messes me up whenever i'm dealing with list so i just have to like manually consciously remember it it's fine though but this right here what we did here is super powerful and it will become more apparent how powerful that is um when we do something later i can't tell you yet i want to tell you but you have to wait but diving deeper into that you'll also see lists referred to as um indexed that's kind of just another way of saying ordered ordered sequence indexed and when i say indexed it just means that each item in our list is assigned a number it's just it's just the order it's in and when we reference a list like this we're calling out the index of that item we're going hey ah here's our camping list item number four pull it out that's what we're doing how cool is that and you probably already noticed that when we are trying to reference a item in a list when we index it we use brackets now quick coffee break i want to cover one more thing that might break your brain but can we just do it real quick it's going to be fun it's really fun i promise coffee it has to do with indexing we're going to index one more time and actually i'm going to change you real quick i'm going to change you you're you're variable you you're still bringing marshmallows but i'm going to change the way i find marshmallows with that list watch this i'm going to change that 9 this is weird negative one now what do you think is going to happen when we print this let's try it out let's run our code hey look it stayed the dang same why well that's called a negative index it does come in handy but essentially what you're doing is you're counting in reverse so instead of starting up here we're starting all the way back here so the very last item in our list would be negative one and you're probably thinking well chuck n uh should be negative zero it's not just isn't you have negative zero it's impossible anyway sorry i didn't mean to get a little angry with you i'm just kidding i wasn't but that's a handy way to access the last item in your list you're probably thinking well that's kind of stupid why would we ever do that well you know sometimes you may not know how big a list is and other times there might be a very good reason they'll access the last item in a list you'll find out that later but let's try it one more what happens if we do go and change it to negative two negative two let's try it out run our code bam beard oil it's now the second to last item in the list and real quick i can't believe we haven't done this yet shame on me let's go and print the entire list at the very end here just print camping list run cool so when we print the camping list guess what it looks just like our list that we have there let me scroll up so you can see it the only difference is that it uses single quotes instead of double quotes it breaks our standard it's okay though we'll forgive it now i told you didn't i i wasn't lying python lists are really fun and really powerful now you probably understand the power they have even just now but you have no idea what's coming up what you can do with these is gonna you know it's just gonna be mind-blowing so i know you can't wait go ahead and move forward to the next episode now if you're watching on youtube it might be like well it's not here i know i create them in batches and i release them week by week sometimes month by month and maybe year by year hush uh no i do release them frequently but they do have them in advance on network chuck academy which you can check out in the link below also in nerdchuck academy is extra practice on the stuff we're covering so if you're like hey i get this i understand it but i want to play with it a bit more first play with it yourself just do more of it but also i'm going to have some exercises some labs and some quiz questions along with all of this at network chuck academy so check it out link below oh and also hey i gotta ask you a question have you hacked the youtube algorithm today let's make sure you do hit that like button notification bell comment subscribe did i hit everything yes you gotta hack youtube today ethically of course yeah that's all i got and also again a huge shout out to the sponsor of this entire series it pro tv again if you're trying to get into it if you want to learn anything in it get a certification or just learn a skill dude they're the place to go again if you use my code network chuck you get 30 off forever don't miss that deal it's not going away because i said forever but you still just don't waste time don't don't wait till tomorrow do it right now you can start learning right now you have a career in a month just do it i'll catch you guys later i'm done talking coffee break [Music] [Applause] [Music] you
Original Description
This video was originally sponsored by ITProTV. We’ve since launched NetworkChuck Academy, our own place to learn IT: https://ntck.co/NCAcademy
FREE Python lab: https://ntck.co/pyep7
🔥🔥🔥🔥Extra Labs and Quizzes at NetworkChuck Academy: https://ntck.co/python
In this installment of NetworkChuck’s Python series, Chuck is going to show you how to use Lists in Python. You will learn how to create your own Python List and also how to Print out the items from your Python List that you are supposed to bring while you prepare for your camping trip!
🔥🔥Get access to all of my courses plus more by joining the NetworkChuck Academy!: https://ntck.co/NCAcademy
**Sponsored by ITProTV
SUPPORT NETWORKCHUCK
---------------------------------------------------
➡️NetworkChuck membership: https://ntck.co/Premium
☕☕ COFFEE and MERCH: https://ntck.co/coffee
Check out my new channel: https://ntck.co/ncclips
🆘🆘NEED HELP?? Join the Discord Server: https://discord.gg/networkchuck
STUDY WITH ME on Twitch: https://bit.ly/nc_twitch
READY TO LEARN??
---------------------------------------------------
-Learn Python: https://bit.ly/3rzZjzz
-Get your CCNA: https://bit.ly/nc-ccna
FOLLOW ME EVERYWHERE
---------------------------------------------------
Instagram: https://www.instagram.com/networkchuck/
Twitter: https://twitter.com/networkchuck
Facebook: https://www.facebook.com/NetworkChuck/
Join the Discord server: http://bit.ly/nc-discord
0:00 ⏩ Intro
0:26 ⏩ [“Let’s”, ”Get”, “Started!”]
0:44 ⏩ The BEST IT training!
1:50 ⏩ Creating your camping list variable!
2:44 ⏩ It’s all coming together!(Kronk voice)
3:18 ⏩ What is a Python list? Ft. Bernard Hackwell
5:24 ⏩ Let’s make our campsite list!(it might be a little dangerous!)
6:42 ⏩ What are you bringing on the trip?
7:35 ⏩ Print out what you are bringing!
8:21 ⏩ Don’t forget the 0!
9:50 ⏩ Time to break your brain!
10:06 ⏩ What the junk is a negative index?
11:05 ⏩ I forgot to print the whol
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from NetworkChuck · NetworkChuck · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Network Chuck
NetworkChuck
Should I Use a Brain Dump on my CCNA/CCNP/MCSA Exam?
NetworkChuck
7 CCNA CCNP Study Tips for the New Year - 2017!!
NetworkChuck
CUCM Calling Search Spaces and Partitions: Explained with Star Wars
NetworkChuck
CCNA or COLLEGE? - Become a Network Engineer
NetworkChuck
How to Stop Procrastinating and Study for Your CCNA CCNP
NetworkChuck
Am I Smart Enough to Be a Network Engineer? - CCNA | CCNP Study
NetworkChuck
CCNA or Python? | Should I Become a Network Engineer or a Programmer?
NetworkChuck
CompTIA or Cisco? - Should I get the CompTIA A+/Network+ OR the Cisco CCNA/CCENT - Microsoft MCSA?
NetworkChuck
CBT Nuggets GIVEAWAY!! - Get Your CCNA, MCSA, VCP, Security+
NetworkChuck
3 Cisco CLI (Command-line) Hacks (CCNA) + CBT Nuggets WINNER ANNOUNCEMENT!!
NetworkChuck
Programmers Becoming Network Engineers? - Collab with SimpleProgrammer
NetworkChuck
Learning Python is HARD!! - CCNA | CCNP Network Engineer
NetworkChuck
You CAN Learn Python - 10 WINNERS!! - CCNA | CCNP Network Engineer
NetworkChuck
Is it still WORTH IT to become a Network Engineer? | CCNA CCNP
NetworkChuck
Should I Learn LINUX with the CCNA | CCNP? - Network Engineer
NetworkChuck
Am I Too OLD to Become a Network Engineer? Study for CCNA | CCNP?
NetworkChuck
How Much Money Do Network Engineers Make? - CCNA | CCNP
NetworkChuck
How Long Does It Take to Become a Network Engineer? - CCNA | CCNP
NetworkChuck
Network Engineer or Systems Engineer? CCNA or MCSA? VCA?
NetworkChuck
CCNA Exam: 2 Exams or 1? - ICND1 (CCENT) + ICND2 or CCNA Composite?
NetworkChuck
I am officially a CBT Nuggets Trainer!! - NetworkChuck
NetworkChuck
7 CCNA CCNP Study Tips for the New Year - 2018!! w/ Keith Barker CCIE
NetworkChuck
Is NetworkChuck Over!?!?!
NetworkChuck
Hack a Cisco Switch with a Raspberry Pi - CCNA Security - CCNP Security - Network+
NetworkChuck
STOP Buying IT Certification Books - CCNA | CCNP | A+ | Network+
NetworkChuck
I'm going to Cisco Live!!! - CiscoLIVE 2018 Orlando
NetworkChuck
How to become a DEVOPS Engineer feat. Shawn Powers | Linux+ | LPIC-1
NetworkChuck
Moving my HOME NETWORK to a DATA CENTER w/ DMVPN - CCNA | CCNP
NetworkChuck
The FUTURE of Information Security Engineers - Cisco Security Automation (DNA CENTER)
NetworkChuck
Network Engineers and AWS (Amazon Web Services) FEAT. Anthony Sequeira | CCNA | CCENT
NetworkChuck
Do You Need IT Certifications to Get Started in IT? ft. Jeremy Cioara
NetworkChuck
What's next for NetworkChuck? *UPDATE* | CCNA | CCNP | Network Automation
NetworkChuck
HOW to Start Coding (RIGHT NOW!) as a Network Engineer - ICND1 | CCNA CCNP & Intent-Based Networking
NetworkChuck
6 STEPS to IT CAREER SUCCESS!! - ft. Kevin Wallace | CCNA | CCNP | CCIE | Network+
NetworkChuck
What is SD-WAN? say GOODBYE to MPLS, DMVPN, iWAN... w/ SDN, Cisco and Viptela
NetworkChuck
What if you forgot EVERYTHING? - Re-Learning IT after MEMORY LOSS w/ Shawn Powers | Linux | CCNA
NetworkChuck
I (FINALLY!) Scheduled Cisco CCNP Certification Exam TSHOOT | 300-135
NetworkChuck
NetworkChuck 10 Days of Christmas 2018 - CBT Nuggets | David Bombal | Kevin Wallace (and more!!)
NetworkChuck
How To get a JOB with a CCNA (Network Engineer) | CCNA Routing and Switching
NetworkChuck
The ONE Skill You NEED in IT - Information Technology
NetworkChuck
Should I start Learning AWS?? - NetworkChuck AMA - Ask Me Anything
NetworkChuck
Using Arduino, Raspberry Pi and Python to Monitor Cisco Router - #DEVNET CCNA
NetworkChuck
Fighting IMPOSTER SYNDROME in Information Technology - Network Engineer | System Engineer | CCNA
NetworkChuck
Planning for 2019 - Information Technology Goals - CCNA | AWS | MCSA
NetworkChuck
CompTIA or Cisco? - Revisiting CCENT vs Network+ in 2019 | CCNA | MTA | MCSA
NetworkChuck
5 Reasons You Shouldn't Become a Network Engineer | CCNA | Information Technology
NetworkChuck
No Future for Network Engineers? - CCNA | CCNP
NetworkChuck
What is a VMware Engineer? | VMware Certified Professional - VCP | MCSA | CCNA
NetworkChuck
you didn't win...
NetworkChuck
Let's QoS My Home Network - LIVE NUGGET (Quality of Service) - CCNA - CCNP Collaboration
NetworkChuck
I PASSED THE TSHOOT EXAM!! - CCNP TSHOOT (I also failed)
NetworkChuck
David Bombal and NetworkChuck - This is IT! EP 1 | Azure, CiscoLIVE, Devnet
NetworkChuck
CCNA Lab in the Azure Cloud for FREE! - GNS3 Setup in Microsoft Azure
NetworkChuck
Get your CCNA in 2019
NetworkChuck
CCNA Cyber Ops vs CCNA Security
NetworkChuck
WI-FI 6, Why it's the BIGGEST update to Wi-Fi EVER! - 802.11ax
NetworkChuck
2 Steps to Getting Started in Networking (and IT!) | CCENT | CompTIA A+
NetworkChuck
HACK your IT Study Habits - CCENT - CCNA - A+ | Atomic Habits
NetworkChuck
Is MPLS DEAD?!? w/ Keith Barker and Jason Gooley | CCNA CCNP CCIE
NetworkChuck
More on: LLM Foundations
View skill →Related AI Lessons
Chapters (13)
⏩ Intro
0:26
⏩ [“Let’s”, ”Get”, “Started!”]
0:44
⏩ The BEST IT training!
1:50
⏩ Creating your camping list variable!
2:44
⏩ It’s all coming together!(Kronk voice)
3:18
⏩ What is a Python list? Ft. Bernard Hackwell
5:24
⏩ Let’s make our campsite list!(it might be a little dangerous!)
6:42
⏩ What are you bringing on the trip?
7:35
⏩ Print out what you are bringing!
8:21
⏩ Don’t forget the 0!
9:50
⏩ Time to break your brain!
10:06
⏩ What the junk is a negative index?
11:05
⏩ I forgot to print the whol
🎓
Tutor Explanation
DeepCamp AI