Skip to content

Latest commit

 

History

History
11 lines (9 loc) · 488 Bytes

File metadata and controls

11 lines (9 loc) · 488 Bytes

Step 3: Ask a user for their name and age.

Write code to tell them how many years you are older than them (negative numbers for younger is fine at this point instead of older / younger with only positive numbers).

>>> my_age = 47
>>> response = input("How old are you? ")
How old are you? 53
>>> their_age = int(response)
>>> diff = their_age - my_age
>>> print(f'Great age! You are {diff} years older than me.')
Great age! You are 6 years older than me.