Page 103 - Trackpad_V2.1_class8
P. 103

On running the above program, we get the following output:

                     Output

                  3
                  33
                  333
                  3333




                 Program 15: To print the pattern of stars in decreasing order in the form of triangle.

                     Program15.py

                  File  Edit  Format   Run    Options   Window    Help

                  #Program to create star pattern

                  for i in range(10, 0, -1):
                      print("*"*i)




                 On running the above program, we get the following output:

                     Output

                  **********
                  *********
                  ********
                  *******
                  ******
                  *****
                  ****
                  ***
                  **
                  *






                                   Imagine, you possess the power of jump statement, allowing you to leap to any
                                   part of the universe. Where would you jump to and what quests or missions
                                   would you undertake in each dimension?




                                                                                                        21 st
                                                                                                     Century   #Flexibility
                                                          Self Reflection                              Skills

                   A computer program is made up of a set of instructions. It blindly follows all the instructions that are given
                                                          Self Reflection
                   to it to perform a set of desired actions. Do you think humans work the same way or do they sometimes
                   question the instructions given to them? Elaborate.





                                                                                        Control Structures in Python  101
   98   99   100   101   102   103   104   105   106   107   108