Page 100 - Programming With Python 3
P. 100

An Introduction to STEM Programming with Python — 2019-09-03a                               Page 87
            Chapter 7 — In, If, Random, and While


             if condition:
                 suite                                                                             Statement
             Free
             The if statement will execute the suite of code if the condition expression is True.

             https://docs.python.org/3/reference/compound_stmts.html#the-if-statement
             http://bit.ly/2AzPg4F

             eBook









             Edition








            Please support this work at




                                  http://syw2l.org


                                         Illustration 14: Flowchart of If
                                                                               Free



            Else



            The suite after an if statement may be followed by the else statement. Else will allow you to have a
                                                                   eBook
            second suite that is executed when the condition is false. This way you can have different statements
            executed for either condition.






                                                                Edition









            Copyright 2019 — James M. Reneau Ph.D. — http://www.syw2l.org — This work is licensed
            under a Creative Commons Attribution-ShareAlike 4.0 International License.
   95   96   97   98   99   100   101   102   103   104   105