Page 139 - Trackpad_V1_Book 8_Flipbook
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 == 0):
                          print(“Hello Trackpad”)
                     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( ) ______________________________________________________________





 PB  Trackpad (Version 1.0)-VIII                                                             Periodic Assessment 3  137
   134   135   136   137   138   139   140   141   142   143   144