Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 86 - 2612_Digimind
P. 86

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

                          Output
                       3
                       33
                       333
                       3333

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

                          Program8.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?

                             Hashtag

                           #Control statements: They are used to control the flow of execution of a program.
                           #Condition: An expression that evaluates to either True or False.

                       84   Premium Edition-VIII

| 81 82 83 84 85 86 87 88 89 90 91 |