Tutorials

Python 3 Tutorial

All Tutorials Learning Tools Login

Python 3 Tutorial · Chapter 8 of 22

Python Input

Read values from the user with input().

input(prompt) reads a line from the console as a string.

Convert with int() or float() when you need numbers.

Input sample Try it Yourself »
name = input("Enter your name: ")
age = int(input("Enter your age: "))
print(f"Hello {name}, you are {age} years old.")

Classroom Tips

  • Provide Console Input before Run when needed.
  • Strip spaces with .strip() if the user adds extras.