Calculate the year of 100 years
Write a program that gets the user's age and calculates what year the user (solar and AD) is 100 years old.
Write a program that gets the user's age and calculates what year the user (solar and AD) is 100 years old.
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
import time current_year = int(time.ctime()[20:]) - 621 age = int(input("Enter your age: ")) print(f'The year when you will be 100: "{current_year+(100-age)}"')
x = int(input("enter age :")) x -= 100 x = abs(x) y = x + 2024 print("you will be 100 years old at",y)
year = int(input('enter your birthyear : ')) month = input('enter your birthmonth : ') day = input('enter your birthday : ') print(year + 100 , month , day)
x = int(input('age:')) y = 100 a = int(input('what is this years ?:')) print('one hundred years old in:',y-x+a)
a=int(input("age:")) b=int(input("yers sham:")) c=int(input("yers mila:")) d=100-a print(b+d,c+d)
def sal (a) :
u = a - 100
u *= -1
u += 2024
y = a - 100
y *= -1
y += 1404
return u , y
age = int (input ('age : '))
r = sal (age)
print (r)
age=int(input("enter your age:")) n=100-age result=n+2024 result_2=n+1403 print(f"you will be 100 years old at {result} AD and {result_2} of solar year.")
Submitting answers is currently unavailable.
You must be logged in to access this section.
Login/Sign up If you don’t understand the exercise or can’t solve it for any reason, that’s completely
normal—don’t worry 😊
Try checking out easier exercises and reviewing different answers
submitted by others. Gradually, you can move on to more challenging exercises. Also, your answer
might be correct even if it’s different from others.