Write a program that asks the user to enter one's name
and age. Print out a message addressed to the user that
tells the user the year in which he/she will turn 100
years old
Answers
Answered by
0
Answer:
in java?? I wanted to know that
Answered by
0
Answer:
INPUT:-
from datetime import datetime
name = input('What is your name? \n')
age = int(input('How old are you? \n'))
hundred = int((100-age) + datetime.now().year)
print ('Hello %s. You are %s years old. You will turn 100 years old in %s.' % (name, age, hundred))
OUTPUT:-
from datetime import datetime
name = input('What is your name? \n')
age = int(input('How old are you? \n'))
hundred = int((100-age) + datetime.now().year)
print ('Hello %s. You are %s years old. You will turn 100 years old in %s.' % (name, age, hundred))
Explanation:
Similar questions
Hindi,
5 months ago
Math,
10 months ago
CBSE BOARD X,
10 months ago
Science,
1 year ago
Chemistry,
1 year ago