Page 114 - modular4.0
P. 114

Chapter Profile
                  C.   Write 'T' for true and 'F' for false.
                      1.  Python does not allow the use of else statement with the while loop.


                      2.   Jump statements are used to complete the loop before the control comes out of
                          the loop body.
                      3.   The statements that are used to repeat a set of instructions are called iterative or
                          looping statements.

                      4.  A single break statement will break out of only one loop.
                      5.  Range() function generates a list of sequence type.

                  D.   Short answer type questions.
                      1.  Define Infinite Loop.


                      2.  What is the purpose of the range() function in Python loops?


                      3.  Explain briefly the two jump statements used in Python.


                  E.   Long answer type questions.
                      1.  Define Looping statements. Why do we use Looping statements in Python?





                      2.  What is the purpose of the range() function in Python loops?




                      3.  Differentiate between for loop and while loop.





                  F.   Write the output of the following programs:


                      1.  i = 1
                          while i < 5:
                              print(i)
                              if i == 3:
                                break

                              i += 1





                112  Modular (Ver. 4.0)-VIII
   109   110   111   112   113   114   115   116   117   118   119