Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
Python

Input and Output in Python

Read user input with input() and display results with print() and f-strings.

Input and Output in Python — a practical guide to Python input output with clear examples you can reuse in real projects.

Python Tutorial Series (11/95). Prefer one article? Read the complete Python tutorial.

Short description

`input()` returns a string. Convert it before doing math. Prefer f-strings for readable output.

I/O example

name = input('Your name: ')
age = int(input('Your age: '))
print(f'Hello {name}, next year you will be {age + 1}')

Leave a reply

Your email address will not be published. Required fields are marked *