Boston Python Workshop 8/Friday/Tutorial: Difference between revisions

Content added Content deleted
imported>Jesstess
imported>Jesstess
Line 504: Line 504:


==Making choices==
==Making choices==

We can use these expressions that <i>evaluate</i> to booleans to make decisions and conditionally execute code.


[[File:Fork.png|100px]]
[[File:Fork.png|100px]]
Line 509: Line 511:
====if statements====
====if statements====


The simplest way to make a choice in Python is with the <code>if</code> keyword. Here's an example:
We can use these expressions that <i>evaluate</i> to booleans to make decisions and conditionally execute code:


<pre>
<pre>