Page 134 - CodePilot V5.0 C7
P. 134

FLOW OF CONTROL

                        9                                  IN PYTHON








                  PRIMARY PREVIEW

                     Python Statements-Flow of Control
                     Python Selection Statements
                     Ternary Operator in Python
                     Python Iterative Statements
                     The Infinite Loop
                     Jump Statements
                     Some More Programs

















                           Hey AIRO, how does a computer make decisions?




                                                    The computer uses conditional statements to check if
                                                  something is true or false and then decides what to do.



                           So, it’s like asking a question
                           and doing something if it’s true?



                                                                         Exactly! Loops help the computer
                                                                   repeat actions until a condition is met.






                           So, loops make the computer repeat tasks?



                                                                 Yes! We will explore both in this chapter.





                   132
                        CodePilot (V5.0)-VII
   129   130   131   132   133   134   135   136   137   138   139