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

2.  Which of the following is/are a looping statement in Python?

                         a.  for statement                             b.  while statement

                         c.  Both a. and b.                            d.  break statement

                3.  Which of the following statements allow/allows to repeat a task for a fixed number of times?

                         a.  for statement                              b.  if statement

                         c.  Both a. and b.                            d.  continue statement

                4.  Which of the following statements terminates the execution of the loop?

                         a.  if                                        b.  for

                         c.  break                                     d.  continue



                Fill in the blanks with the correct words.


                                    Hints  infinite, break, while, continue, non-zero, false


                1.   The                  statement executes a set of statements repeatedly, until the logical
                   expression remains true.

                2.   Any                  value in the while loop indicates an always true condition whereas zero
                   indicates                   condition.

                3.  The                   loop never ends.

                4.  The                   and                   are the jump statements in Python.


                 Tick ( ) the correct statements and cross ( ) the wrong ones.


                1.  The break statement is used inside the if statement.

                2.  The continue statement breaks the loops one by one.

                3.   To come out of the infinite loop, we can either close the program window or press Ctrl + C.


                4.  A sequence is a succession of values bound together by a single name.

                5.  The while statement is the looping statement.


          Q     Answer the following questions:
            A
                1.  What are looping statements?




                2.  Write the syntax of the for loop.






            106  Plus (Ver. 4.0)-VIII
   103   104   105   106   107   108   109   110   111   112   113