Skip to content
← Back to Community
How do I subtract from an input anser
Profile icon
MihaiTIRZIU

For example:
age = input('How old are you?')
print('Last year, you were'...'years old.')

If I say for example, 15, how do I make it say 14?
(using format or int)

Answered by Zyugyzarc [earned 5 cycles]
View Answer
Voters
Profile icon
CelineLartey
Profile icon
MihaiTIRZIU
Comments
hotnewtop
Profile icon
Zyugyzarc

print( f"Last Year, you were {int(age) -1} years old")