184_notes:if

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revisionBoth sides next revision
184_notes:if [2022/04/20 15:24] woodsna1184_notes:if [2022/05/06 22:02] woodsna1
Line 7: Line 7:
     quotient = numerator/denominator     quotient = numerator/denominator
 </code> </code>
-Everything that follows the word "if" is called the conditional. The code within an if statement will only execute if the conditional evaluates to True. In this case, we only compute the quotient for a nonzero denominator. You can read if statements out loud to understand what they're doing. In the above example, the if statement could be read as "if the denominator is not equal to 0, divide".+Everything that follows the word "if" is called the conditional. The code within an if statement (the indented code) will only execute if the conditional evaluates to True. In this case, we only compute the quotient for a nonzero denominator. You can read if statements out loud to understand what they're doing. In the above example, the if statement could be read as "if the denominator is not equal to 0, divide".
  
 ===== Else Clauses ===== ===== Else Clauses =====
  • 184_notes/if.txt
  • Last modified: 2022/05/07 01:21
  • by woodsna1