Review 01-05
A few questions to review the concepts from lessons 1-5.
-
The key next to the return key has both a single and double quote on it. Write a single print statement to show both characters on that key.
<figure> <img src="/ecs/python/review-01-05/keys.png"/> <figcaption> <h4>Part of a keyboard</h4> </figcaption> </figure>
-
Line maker: input an integer m. Fill in the value of m in the print statement below.
- Print: y = m * x
- Print the answer to the question: when x = 8, what is y?
Example: person types “3”, then the program prints out:
y = 3 * x 24
-
Ask a person’s name. Store it in a variable. Print out: [name]’s puppy said, “Woof!” Example:
What is your name? Mario Mario's puppy said, "Woof!"
-
Short multiplication table: Ask for the value of
y
. Print out the numbers 1y, 2y, 3y, and 4y.What is y? 5 5 10 15 20
-
Ask for a noun and a verb. Print out “The [noun] [verb]ed.”
noun? apple verb? cook The apple cooked.
Review Info
Ways to fill in a blank:
print("I am {}.".format(name))
print("You are",name)
print("I do not "+verb+" anymore.")
print("He is "+str(age)+" years old.")
Write an advantage or disadvantage of each.