Write a program that ask the user to enter the current year and the year of birth. Then, the program should compute the age by subtracting the year of birth from the current year and display the result (which represents the age). Use the following formula: ๐ด๐๐ = ๐๐ข๐๐๐๐๐ก ๐ฆ๐๐๐ โ ๐๐๐๐กโ ๐ฆ๐๐
cur_year = int(input("current year: "))
birth_year = int(input("year of birth: "))
print("age =", cur_year - birth_year)
Comments
Leave a comment