Review 01-05

  1. 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.

    Part of a keyboard

  2. 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
  3. 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!"
  4. Short multiplication table: Ask for the value of y. Print out the numbers 1*y, 2*y, 3*y, and 4*y.

     What is y? 5
     5 10 15 20
  5. 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:

  1. print("I am {}.".format(name))
  2. print("You are",name)
  3. print("I do not "+verb+" anymore.")
  4. print("He is "+str(age)+" years old.")

Write an advantage or disadvantage of each.