Python Input Example

This beginner Python example shows how the browser-side compiler handles input() prompts through the terminal. Use it to test stdin, type conversion, and formatted strings without installing Python locally.

Python Compiler

Code Example

name = input("Enter name: ")
age = int(input("Enter age: "))

print(f"Hello {name}")
print(f"Next year you will be {age + 1}")

Expected Output

Enter name: Mayur
Enter age: 23
Hello Mayur
Next year you will be 24

Practice Steps

  1. Open the Python compiler and paste the code.
  2. Run the program, then enter a name and age when the terminal asks.
  3. Change the message or calculation and run it again.
HOME LEARN COMMUNITY DASHBOARD