Skip to content
Omni Academy
Search courses and lessons
Search
Courses
Backend Development
9
Databases
1
Frontend Development
5
Data Science
5
All courses →
Playground
HTML & CSS
JavaScript
TypeScript
Python
PHP
Ruby
Light
Dark
Auto
Sign in
Get started
All
Backend Development
Databases
Frontend Development
Data Science
Playground
Blog
HTML
JS
TS
PY
PHP
RB
← Courses
📄
Reading input
Run as I type
Reset
▶
Run
Ctrl
↵
PY
Python source code
# input() reads the Input box below the editor - one line per call. # Two lines are waiting there already; change them and run again. name = input("What is your name? ") year = int(input("What year were you born? ")) age = 2026 - year print(f"Hello, {name}.") print(f"You turn {age} this year.") if age >= 18: print("Old enough to vote in most places.") else: print(f"{18 - age} years until you can vote in most places.") # int() raises on anything that is not a whole number, which is what you # want: a clear error here beats a wrong answer later.
Input
one line per
input()
call
Aisha 1997
Output
Rendered by your browser