Anonymous user
Boston Python Workshop 4/Friday/Tutorial: Difference between revisions
Boston Python Workshop 4/Friday/Tutorial (view source)
Revision as of 22:19, 27 September 2011
, 12 years ago→compound conditionals: and and or
imported>Jesstess |
imported>Jesstess |
||
Line 585:
====compound conditionals: <code>and</code> and <code>or</code>====
You can check multiple expressions together using the <code>and</code> and <code>or</code> keywords. If two expressions are joined by an <code>and</code>, they <b>both</b> have to be True for the overall expression to be True. If two expressions are joined by an <code>or</code>, as long as <b>at least one</b> is True, the overall expression is True.
Try typing these out and see what you get:
<pre>
|