I’m new to python and I’m trying to do a simple application (age calculator); I’m using Python 3.
This is my code:
date=2012
age=input("type in the date you born to calculate your age")
print ("your age is ") + (date-age)
It seems fine to me, but it gives me a TypeError: cannot concatente 'str' and 'int' objects.
Try:
strwill cast your integer result to a string so that it can properly be “added” to the rest of the string.