Dec-27-2016, 07:00 AM
Using python3 and am new - learning via introtopython.org and I'm having a problem.
What am I doing wrong? When I change the variable to a string the line executes properly.
var1 = (2+2) print('The result of all calculations is ' + var1 + ' and we are done.')Which returns the error of
Quote:Traceback (most recent call last):
File "test.py", line 3, in <module>
print('The result of all calculations is ' + var1 + ' and we are done.')
TypeError: Can't convert 'int' object to str implicitly
What am I doing wrong? When I change the variable to a string the line executes properly.