Page 108 - TP_Play_V2.2_Class8
P. 108

Double Tap                                                   Century   #Critical Thinking
                                                                                       21 st
                                                                                      Skills
                     What will be the output of the given Python code?
                     a.   i = 0
                         while (i == 0): print(“Hello Touchpad”)

                     b.   i = 1
                         while (i<=5):
                           print("i=",i)
                           i+=1
                         print("Done")





                   SOME MORE PROGRAMS


              Program 9: To create a number pattern using for loop


                   Program9.py
               File  Edit  Format    Run   Options   Window    Help

                #Program to create number pattern using for loop


                for i in range(1,10):
                    print('3' * i)




              You will get the following output:

                   Output

                3
                33
                333
                3333
                33333
                333333
                3333333
                33333333
                333333333











                  106  Plus (Ver. 4.0)-VIII
   103   104   105   106   107   108   109   110   111   112   113