Predicting next year's age from user input

Report a typo

A user inputs their age in a program as a string. You need to perform an operation to predict their age in the next year. As the program involves string concatenation and arithmetic operations, you are asked to fill the blanks in code to correctly print 'Your age next year will be: [next year age]' given the user's current age.

Fill in the gaps with the relevant elements
userAge = '22'
print('Your age is: ' + userAge)

nextYearAge = (userAge) + 1
print('Your age next year will be: ' + (nextYearAge))
intstr

Create a free account to access the full topic