Revise Computingrevisecomputing.co.uk
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates

Knowledge organisers / Input

Input basics

All topicsPractise exam questions
Knowledge organiser

Input

301.6a

Read text input from user.

What you need to know

The input() function pauses the program and waits for the user to type something. It always returns a string, even if the user types a number.

Key points

  • input() returns a string, always
  • Pass a prompt message: input("Enter name: ")
  • The program pauses until the user presses Enter
  • Store the result in a variable: name = input("Name: ")

Code examples

Basic input
python
name = input("What is your name? ")
print("Hello,", name)