From the course: Programming Foundations: Real-World Examples

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Parking with lists

Parking with lists - Python Tutorial

From the course: Programming Foundations: Real-World Examples

Start my 1-month free trial

Parking with lists

- Lists and tuples are two data structures that you can use to store a collection of objects in a specific order. You can visualize a list as a row of objects sitting in a line. Every object in the list is indexed by a number, and in the world of programming numbering starts with a zero for the first item, one for the next item, and so on down the line. You can use these indexes to insert, modify, and remove individual items from within the list. - Hey, you're back from the store. - Yup, and when I was there, parking my car, I had a moment of brilliance. I figured out how I can explain lists. - What do lists and cars have to do with one another? - Olivia, that's a really good question. Let me tell you a story. In a lot of ways, you can think of a list of objects like a row of parked cars. The cars are in order, starting with the first car on the end, which is at index number zero. When I arrived at the store today, I decided to append my car to the list by parking at the end of the…

Contents