August 2020
Beginner
440 pages
12h 2m
English
Writing code makes me hungry! Let’s write a program to list some tasty foods we’d like to eat.
So far we’ve worked with single variables, like a name to say “hello” to or a nautical-themed object to point out. In this program, we want to keep track of one or more foods that we will store in a list, a variable that can hold any number of items. We use lists all the time in real life. Maybe it’s your top-five favorite songs, your birthday wish list, or a bucket list of the best types of buckets.
In this chapter, we’re going on a picnic, and we want to print a list of items to bring along. You will learn to
Write a program that accepts multiple positional arguments
Use if, elif, and else to handle conditional ...
Read now
Unlock full access