Page 129 - trackpad v5.1 class 8 flipbook
P. 129

Periodic Assessment                          3

                                                    (Based on chapters 6 to 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  127
   124   125   126   127   128   129   130   131   132   133   134