Below is a code for the Python program NewAge2.py:
Python
# Assign a constant named YEAR with the value 2050
YEAR = 2050
# Get the current year
currentYear = 2023
# Calculate the age in 2050
myCurrentAge = 30
myNewAge = myCurrentAge + (YEAR - currentYear)
# Print the result
print("I will be" + str(myNewAge) + "in 2050.")
The code output will be: I will be 57 in 2050
So, The first line of code sets a constant called YEAR to the number 2050. A constant is a type of variable that cannot have its value altered. The next line of code gets the present year by using the datetime module.
Lastly, The third line of code figures out how old someone will be in 2050 by adding their current age to the difference between the year 2050 and the current year. The fourth code line shows the answer on the screen.