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