Page 59 - Modular v1.1 Pyhton
P. 59

Periodic Assessment-2

                                                     (Based on chapters 4 & 5)



                 A.    What will be the output of the following Python codes:
                      1.    i = 0

                            while (i == 0):
                               print("Hello Touchpad")





                      2.    def info(name, age):
                                 "This will prints a passed
                                 information into the function"

                                 print("Name: ", name)
                                 print("Age: ", age)
                                 return
                            #Now print information function is called

                            info(age=21, name="Taarush")
                 B.     Write a program to add first five natural numbers by using the while loop.





























                 C.    Define the following:

                      1.     Parameters ……………………………………………………………………………………………………………………………...

                      2.     built-in functions  ……………………………………………………………………………………………………………………

                      3.     Infinite loop …………………………………………………………………………………………………………………………….

                      4.     range() Function ……………………………………………………………………………………………………………………..


                                                                                         Periodic Assessment-2    57
   54   55   56   57   58   59   60   61   62   63   64