Sep-23-2019, 01:29 AM
The problem is that the + operator can't be used between a string (' you are ') and an int, such as age. So you need to either convert the int to a string before using the plus operator, like this:
print(' you are ' + str(age) + ' years old. ')or better yet, use string formatting
print(' you are {} years old. '.format(age))or if you're using the latest version of Python, you can even do this
print(f' you are {age} years old. ')