Programming Examples
Python program that inputs an age and print age after 10 years
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!
Solution
age = int(input("What is your age? "))
print("In ten years, you will be", age + 10, "years old!")
Output/ Explanation:
What is your age? 17
In ten years, you will be 27 years old!