Review 01-05

A few questions to review the concepts from lessons 1-5.
  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.

    <figure>
        <img src="/ecs/python/review-01-05/keys.png"/> <figcaption>
                <h4>Part of a keyboard</h4>
            </figcaption>
    </figure>
    
  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 1y, 2y, 3y, and 4y.

      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.

Last modified August 18, 2023: 2022-2023 End State (7352e87)