Boston Python Workshop 8/Friday/Tutorial: Difference between revisions
Content added Content deleted
imported>Jesstess |
imported>Jesstess |
||
Line 575: | Line 575: | ||
====compound conditionals: <code>and</code> and <code>or</code>==== |
====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 <code>True</code> for the overall expression to be <code>True</code>. If two expressions are joined by an <code>or</code>, as long as <b>at least one</b> is <code>True</code>, the overall expression is <code>True</code>. |
You can check multiple expressions together using the <b><code>and</code></b> and <b><code>or</code></b> keywords. If two expressions are joined by an <code>and</code>, they <b>both</b> have to be <code>True</code> for the overall expression to be <code>True</code>. If two expressions are joined by an <code>or</code>, as long as <b>at least one</b> is <code>True</code>, the overall expression is <code>True</code>. |
||
Try typing these out and see what you get: |
Try typing these out and see what you get: |