Anonymous user
Boston Python Workshop 6/Friday/Tutorial: Difference between revisions
Boston Python Workshop 6/Friday/Tutorial (view source)
Revision as of 02:38, 27 March 2012
, 12 years ago→Printing
imported>Jesstess (→Math) |
imported>Jesstess |
||
Line 228:
w = "World"
print h + w
</pre>
Line 239 ⟶ 238:
<pre>
print "Hello" + 1
</pre>
Line 273 ⟶ 271:
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.
We can convert an integer into a string ourselves, using the <code>str</code> function:
|