input()

noun

say it: “IN-put” /ˈɪnpʊt/

A Python function that pauses the program, waits for the user to type something and press Enter, and gives back what they typed as a string.

What does input() do?

input() pauses the program and waits for the user to type something and press Enter. What they typed comes back as a string.

name = input("What's your name? ")
print("Nice to meet you,", name)

In a sentence

  • “input("What's your name? ") waited for the user to answer.”
  • “Because input gives back text, the age had to be turned into an int.”

Level: Novice · More Python terms at this level

Updated

In other subjects