Anonymous user
Boston Python Workshop 6/Friday/Tutorial: Difference between revisions
Boston Python Workshop 6/Friday/Tutorial (view source)
Revision as of 14:04, 31 March 2012
, 12 years ago→End of Part 2
imported>Jesstess |
imported>Adamf |
||
(5 intermediate revisions by one other user not shown) | |||
Line 364:
3.
<pre>
print 2.0 * 123 + str(2.0) * 123
</pre>
Line 459 ⟶ 458:
</pre>
Use <code>==</code> to test for equality. Recall that <code>=</code> is used for <i>assignment</i>
This is an important idea and can be a source of bugs until you get used to it: <b>= is assignment, == is comparison</b>.
Line 744 ⟶ 743:
Functions don't have to return anything, if you don't want them to. They usually return something because we usually want to be able to assign variables to their output.
==End of Part 2==
Line 762 ⟶ 751:
Take a break, stretch, meet some neighbors, and ask the staff if you have any questions about this material.
|