Calculate birth year from current age

Report a typo

Write a program that takes a person's age as input and prints out the year they were born. Assume the current year is 2023. The program should: - Take the user's current age as input (an integer) - Calculate the year they were born by subtracting their age from the current year - Print the calculated birth year as output

Sample Input 1:

25

Sample Output 1:

1998

Sample Input 2:

50

Sample Output 2:

1973
Write a program in Python 3
# Take the user's current age as input
current_age = int(input())

# Current year
current_year = 2023

# Calculate the birth year

# Print the birth year

Create a free account to access the full topic