Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

I. Learning to Program > 3. Strings, Lists, Tuples, and Maps

Chapter 3. Strings, Lists, Tuples, and Maps

In Chapter 2, we did some basic calculations with Python, and you learned about variables. In this chapter, we’ll work with some other items in Python programs: strings, lists, tuples, and maps. You’ll use strings to display messages in your programs (such as “Get Ready” and “Game Over” messages in a game). You’ll also discover how lists, tuples, and maps are used to store collections of things.

Strings

In programming terms, we usually call text a string. When you think of a string as a collection of letters, the term makes sense. All the letters, numbers, and symbols in this book could be a string. For that matter, your name could be a string, and so could your address. In fact, the first Python program we created in Chapter 1 used a string: “Hello World.”


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint