1.7 - Input
1.7 - Input
Input
ICS 3U0
Today’s Agenda
You need to be careful with the input function. You CANNOT use commas to connect the prompt like
you can with the print function.
max_age = 105
min_age = 1
print("Please enter your age. The number you enter should be less than ",
max_age, "and greater than", min_age)
max_age = 105
min_age = 1
age = input("Please enter your age. The number you enter should be less
than", max_age, "and greater than", min_age)
print(age)
Example 2 – Correct input function
The input and print functions are different! The input
function is ONLY looking for strings as a prompt AND you cannot
use commas to connect strings. You need to use + and you need
to make sure that everything you are adding together are STRINGS