Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1name = input("What is your name? ") | AThe prompt text is missing quote marks, so Python thinks it is code instead of text. It should be input("What is your name?"). | |
| 2print("Hi " + name) | Bcolour = input("Favourite colour? ") | |
| 3The question that Scratch shows in ask and wait goes inside the brackets of input() as text in quotes | CThe reply is never stored in a variable, so name does not exist. It should start with name = input(...). | |
| 4The Scratch answer reporter is only available until the next question, so Python stores the reply in a named variable to use later | Dinput("How old are you? ") | |
| 5name = input(What is your name?) | EShows the question, waits for the user to type a reply, and stores it in the variable name | |
| 6input("What is your name? ") print("Hi " + name) | FUses the stored reply, like putting the Scratch answer reporter into a say block |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
name = input("What is your name? ") — Like Scratch ask and wait: input() shows the prompt, waits for a reply, and the answer is stored in a variable (name), just like the answer reporter.name = input("What is your name? ")name = input("What is your name? ")
print("Hi", name)name = input("What is your name? ")name = input("What is your name? ")
print("Hello", name)city = input("Which city do you live in? ")