Exercise 23

Introductory Lists

Most programming languages have some way to store data inside the computer. Some languages only have raw memory locations, but programmers easily make mistakes when that’s the case. In modern languages you’re provided with some core ways to store data called “data structures.” A data structure takes pieces of data (integers, strings, and even other data structures) and organizes them in some useful way. In this exercise we’ll learn about the sequence style of data structures called a "list" or "Array" depending on the language.

Python’s simplest sequence data structure is the list, which is an ordered list of things. You can access the elements of a list randomly, in order, extend it, shrink it, and do most anything ...

Get Learn Python the Hard Way: A Deceptively Simple Introduction to the Terrifyingly Beautiful World of Computers and Data Science, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.