Lazo Lab Sign up

Python Fundamentals / Getting started

Lesson 9 of 38

Getting input

input() pauses and waits for the user to type something. It always returns a string, so convert it with int() or float() if you need a number.

Key points

  • input() always gives a string
  • int("42") gives 42
  • Show a clear prompt
age = int(input("How old are you? "))
print(f"Next year you'll be {age + 1}")
Watch a video on thisOpens YouTube search results for “Getting input” in a new tab

Quiz · +10 XP

What type does input() return?

Log in to save progress and earn XP.