Boston Python workshop 2/Friday tutorial: Difference between revisions

Line 218:
<code>TypeError: cannot concatenate 'str' and 'int' objects</code>
 
Python is giving us a '<b>traceback'</b>. A traceback is details on what was happening when Python encountered an Exception or Error -- something it doesn't know how to handle.
 
There are many kinds of Python errors, with descriptive names to help us humans understand what went wrong. In this case we are getting a '<code>TypeError'</code>: we tried to do some operation on a data type that isn't supported for that data type.
 
Python gives us a helpful error message as part of the TypeError:
Line 240:
</pre>
 
produces a <code>TypeError</code>. We are telling Python to concatenate a string and an integer, and that's not something Python understands how to do.
 
In the similar expression
Anonymous user