Why am i getting a 'typeerror' when trying to concatenate a string and an integer?


age = 25
message = 'I am ' + age + ' years old.'

age = 25
message = 'I am ' + str(age) + ' years old.'
In Python, you can't directly concatenate strings with other data types. Convert the integer to a string using the `str()` function before concatenating.

Beginner's Guide to Python