CHAPTER 11
Working with Lists, Strings, and Text I/O
Breakfast gets wild with Wacky Waffles! In this chapter, you code a toy where your user makes waffles topped with unpredictably silly toppings (think licorice and plum)! Coding this project will introduce you to important programming concepts, including lists, string variables, and concatenation. You’ll also reuse skills you know, like working with variables and using randomness.
A list is a group of related variables organized under one label. In Wacky Waffles, you’ll make two lists: one for candy and one for fruit. The program will ask the user to input items into the lists, and then it will pull a random item from each to create a candy and fruit combo. The wacky waffle name will then be output to the user.
The text items input and output are known as strings, a type of variable (usually, letters and words). You put together string inputs using concatenation, which means sticking words together. Get ready to make some strange and sweet creations — and learn how lists and strings can superpower your programs!

Brainstorm
Your game can be about putting together any two (or more) things in a crazy combination. What about a crazy sports game that combines any rackets, balls, and sports courts? The output might produce a new game in which you hit a football with a bat in a swimming pool. Time to get creative — and start coding! ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access