Let’s look at another Python program that creates short nonsense sentences:
Listing 2.1: Mad Lib
1 # madlib.py
2 # Your Name
4 adjective = input("Enter an adjective: ")
5 noun = input("Enter a noun: ")
6 verb = input("Enter a verb: ")
7 adverb = input("Enter an adverb: ")
8 print("A", adjective, noun, "should never", verb, adverb)
Type this program into your Python environment, save it as madlib.py, and run it a few times to play with it. Enter any responses you like when the interpreter asks for them. Then consider the following aspects of both this program and Listing 1.1.
Every program accomplishes its work by manipulating data. Variables are names that refer to data in memory. Variable ...