Computer Science
Write a program that inputs an age and print age after 10 years as shown below:
What is your age? 17
In ten years, you will be 27 years old!
Python
Python Data Handling
56 Likes
Answer
a = int(input("What is your age? "))
print("In ten years, you will be", a + 10, "years old!")
Output
What is your age? 17
In ten years, you will be 27 years old!
Answered By
25 Likes
Related Questions
Write a program that asks a user for a number of years, and then prints out the number of days, hours, minutes, and seconds in that number of years.
How many years? 10
10.0 years is:
3650.0 days
87600.0 hours
5256000.0 minutes
315360000.0 secondsWrite a program whose three sample runs are shown below:
Sample Run 1:
Random number between 0 and 5 (A) : 2
Random number between 0 and 5 (B) :5.
A to the power B = 32Sample Run 2:
Random number between 0 and 5 (A) : 4
Random number between 0 and 5 (B) :3.
A to the power B = 64Sample Run 3:
Random number between 0 and 5 (A) : 1
Random number between 0 and 5 (B) :1.
A to the power B = 1Write a program to take two inputs for day, month and then calculate which day of the year, the given date is. For simplicity, take 30 days for all months. For example, if you give input as: Day3, Month2 then it should print "Day of the year : 33".
Write a program that generates six random numbers in a sequence created with (start, stop, step). Then print the mean, median and mode of the generated numbers.