Check your understanding of the previous reading: valid and good variable names, and how variables differ from math.
Choose which of the following are valid Python variable names. Note that they do not have to be good variable names, just valid.
Select every name that is a valid Python identifier, then check.
page_count).There are only two rules: a name can only contain letters, numbers, and underscores, and it must begin with a letter or an underscore (never a digit).
You have a variable that represents your allowance, measured in dollars. Which of the following are good variable names? In this case, "good" means that they are not too long, not too short, and the intent of the variable is unambiguous.
Select every name that is a good choice, then check.
d holds.allowance says the same thing more concisely.Think of the Five Cs from the reading: clear, concise, correct, consistent, conventional. Reject names that are too short to be clear, too long to be concise, or that describe the type instead of the meaning.
True or false: a variable is useful because it allows you to solve for an unknown value.
Select one answer, then check.
Re-read the "Different from Math" section: who is doing the "solving" when a program runs?
True or false: variable names are important because computers understand the meaning of names and change their value accordingly.
Select one answer, then check.
Re-read the "Names" section: who is a good variable name actually for?