I wrote this simple code and tried to execute in Windows 10 CMD ... and it gets the error message :
TypeError: Can only concatenate str (not \"int\") to str
TypeError: Can only concatenate str (not “int”) to str
This Error states that it can only concatenate string to string. In your program you have tried to concatenate a sting and integer
Input command would only fetch string from the user, and the age the user enters should be taken as string. Examples: '45', '25', 36 etc..
This program is trying to concatenate '45' + 2 . Which throws this error.
Instead you can try converting the user input to int and then concatenate.
userName = input('Name: ')
age = int(input('age: '))
finalAge = age + factor
factor = 2
finalAge = age + factor
print('In ', factor, 'years you will be', finalAge, 'years old', userName, '!')