Menu

Input Function - Code Quiz

1. Which line should replace the comment so the user's answer is stored in the variable name?

# line missing here print('Hello, ' + name)
name = Input('What is your name? ')
name = input('What is your name? ')
name = input(What is your name? )
input('What is your name? ')

2. What happens when this code runs?

name = input('What is your name? ) print('Hello, ' + name)
It prints Hello, followed by the answer
It asks the question twice
It prints Hello, on its own
It stops with a syntax error

Log in or sign-up to access the quiz



Don't have a login?

You can still revise this topic