Page 139 - Trackpad_V5_Book 8
P. 139

Periodic Assessment                          3

                                                (Based on chapters 7 & 8)

            1.  What will be the output of the following Python codes:

              a.
                   i = 0

                   while (i <= 5):
                   print(“Hello Trackpad”)

                   i += 1
              b.

                   i = 0
                   while i < 5:
                         print(i)

                         i += 1
                         if i == 3:
                             break
                         else:
                             print(0)
            2.  Write a program  to print the even  numbers  between  1 and  25  by using the continue
               statement.


























            3. Write the use of the following functions.
              a.  len() ______________________________________________________________

              b.  append() ___________________________________________________________

              c.  capitalize() _________________________________________________________

              d.  del( ) ______________________________________________________________




                                                                                        Periodic Assessment 3  137
   134   135   136   137   138   139   140   141   142   143   144