input() — Listens (User sends text into a variable)
print() — Speaks (Program displays result on screen)
input() Inside a Variable
+ Explore
input() without assigning it to a variable is like asking someone their name and immediately forgetting it!
# [AVOID] — The user's answer is never stored and vanishes immediately!
input("Enter your name: ")
print(name) # NameError: name 'name' is not defined
# [GOOD] — Catch the user's response inside a variable box!
name = input("Enter your name: ")
print("Hello, " + name)
input() Always Returns a String!
+ Explore
# 1. input() always gives you a string (text)
raw_age = input("Enter your age: ") # User types 25 → raw_age is "25" (str)
# 2. Cast to int so you can do arithmetic
age = int(raw_age) # age is now 25 (int)
next_year = age + 1 # 26 (int)
# 3. Cast back to str if gluing into a sentence with +
print("Next year you will be " + str(next_year))
input() and print().