input() function, online

Six activities your students do on their own devices. See who's finished, and their scores.

input() function in one minute

What students need to know

input("Name") is valid syntax with matching double quotes. input() displays the prompt string, then pauses until the user presses Enter.

The prompt is optional — without it, input() just waits silently. The prompt must be a string in quotes — otherwise Python looks for a variable called Hi.

Mistakes students make

  • Misspelling: imput.
  • Missing closing bracket.
  • Capital I error.
  • Missing opening quote.
PREVIOUS · MODULE 1print() function
YOU ARE HERE · MODULE 2input() function
NEXT · MODULE 3Comments

Discover other journeys with this module

What students will learn in this module

Every question in Module 2

Quick questions

  1. What does input("Name: ") do?AShows 'Name: ' then waitsBShows 'Name: ' then continues
  2. What does input() without a prompt show?AThe word 'input()'BNothing - just waits for input
  3. When does the program continue after input()?AImmediatelyBAfter user presses Enter
  4. What does input('Age: ') display?AAge: Binput('Age: ')
  5. Which is correct?Ainput("Hi")Binput(Hi)

Key terms

Students type the meaning of:

  • input('Press Enter')

Match the pairs

input("Name')Match it to what it does
input(Name)Match it to what it does
input("Name")Match it to what it does
input()Match it to what it does
input('>>> ')Match it to what it does
input('Age: ')Match it to what it does

Fill in the blanks

  1. _____('Name: ')
  2. input_'Age: ')
  3. input('City: '_
  4. input('Email__
  5. _____('Press Enter'_

Spot the error

Question 1

Aprint('Welcome')Bimput('Name: ')Cinput('Age: ')

Question 2

Ainput('First name: ')Binput('Last name: 'Cinput('Email: ')

Question 3

Aprint('Registration')Binput('Name: ')CInput('Age: ')Dinput()

Question 4

Ainput('Username: ')Binput(Password: ')Cprint('Login complete')

Question 5

Aprint('Enter details')Binput('Name: ')Cinput('Age: ')Dinput 'City: ')