The input() function lets your program ask questions and wait for answers. Whatever the user types becomes text (string) that you can store in a variable. You can convert text to numbers using int() or float() if you need to do math with the input.
# Getting user input
# Ask for name
name = input("What is your name? ")
print("Hello", name + "! Nice to meet you!")
# Ask for age (input always gives text, so convert to number)
age_text = input("How old are you? ")
age = int(age_text) # Convert text to number
birth_year = 2024 - age
print("You were born around", birth_year)
# All in one line
favorite_color = input("What's your favorite color? ")
print("Wow,", favorite_color, "is a beautiful color!")
# Simple calculator
num1 = input("Enter first number: ")
num2 = input("Enter second number: ")
result = float(num1) + float(num2)
print("Sum:", result)