Question: Write a program that asks the user to enter his name and age and prints on the screen the year in which he was

Write a program that asks the user to enter his name and 


Write a program that asks the user to enter his name and age and prints on the screen the year in which he was born and when he will be doubled in age. Sample Run: Enter your name: Sami Hi Sami, what is your age? 21 You were born in 2001 and you will have 42 years old on 2043

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres a Python program that achieves the desired functionality Python def calculatebirthanddoubleagename age This function takes a name and age as input and calculates the birth year and year when the person will be double their age Args name The users name as a string age The users age as an integer bornyear 2024 age doubleageyear bornyear 2 age printfHi name you were born in bornyear and you will be doubled in age on doubleageyear Get user input name inputEnter your name age intinputHi what is your age formatname Call the function to calculate and print results calculatebirthanddoubleagename age Explanation Function definition The code defines a function calculatebirthanddoubleage ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!