Page 107 - Plus V4 with Adobe class 8
P. 107

You will get the following output:




























                     NASA’s reusable space shuttle in the 1970s had less code than our phones today.





                       Timeline



                       Looping statements are very useful and necessary for developing applications.
                       Python provides two types of looping statements—for and while.
                       The for statement executes a simple or compound statement for a fixed number of times.
                      The range() function is an in-built function of Python.

                       A sequence is a succession of values bound together by a single name.
                       The while statement executes a set of statements repeatedly, until the logical expression evaluates
                     to true.
                       To come out of the infinite loop, we can either close the program window or press Ctrl + C.









                   Choose the correct option.


                   1.  What does while loop do?
                            a.  Repeats a chunk of code a given number of times


                            b.  Repeats a chunk of code until a condition is true

                            c.  Repeats a chunk of code until a condition is false

                            d.  Repeats a chunk of code indefinitely




                                                                                              #Loops in Python 105
   102   103   104   105   106   107   108   109   110   111   112