Anonymous user
Boston Python Workshop 3/Friday/Tutorial: Difference between revisions
Boston Python Workshop 3/Friday/Tutorial (view source)
Revision as of 02:13, 17 June 2011
, 13 years ago→if statements
imported>Jesstess |
imported>Jesstess |
||
Line 534:
That was our first multi-line piece of code, and the way to enter it at a Python prompt is a little different. First, type the <code>if True:</code> part, and hit enter. The next line will have <code>...</code> as a prompt, instead of the usual <code>>>></code>. This is Python telling us that we are in the middle of a <b>code block</b>, and so long as we indent our code it should be a part of this code block.
Type 4 spaces, and then type <code>print "I'm True!"</code>. Hit enter to end the line, and hit enter again to tell Python you are done with this code block. All together, it will look
<pre>
|