O'Reilly logo

Learn to Program with Python 3: A Step-by-Step Guide to Programming by Irv Kalb

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

© Irv Kalb 2018
Irv KalbLearn to Program with Python 3https://doi.org/10.1007/978-1-4842-3879-0_7

7. Lists

Irv Kalb1 
(1)
Mountain View, California, USA
 
Prior to this chapter, we’ve talked about four types of data: integer, float, string, and Boolean. But imagine that you want to represent a lot of data—for example, the names of all the students in a class, or better yet, the names of all students in a school, or city, or state. So far, our definition of a variable allows us to only represent a single piece of data. Therefore, if we wanted to represent a group of students’ names, we would do something like this:
student1 = 'Joe Schmoe'
student2 = 'Sally Smith'
student3 = 'Henry Jones'
student4 = 'Betty Johnson'
student5 = 'Chris Smith'

Every time we get ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required