Turning Text Into a Number
Real programs often receive input as text.
count_text = "7"
count = int(count_text)
print(count + 1)Here is what the example does:
count_textstores the text "7".countstores the returned value fromint(count_text).print(count + 1)displays the result ofcount + 1.
The assignment changes the specific values, but the basic pattern is the same.
Assignment
Complete the starter code so the program does the following:
- Print
int(age_text) + 1.
Your finished program should print exactly this output:
13Be very careful with capitalization, spaces, and line breaks. The output must match exactly.