Page 136 - TechPluse_C8_Flipbook
P. 136

range(start, stop, step_size): By default,  the value of the step_size  =  1 and numbers
                      generated with a difference of 1. However, we can generate numbers by specifying the value

                      of step_size according to our requirement.
                      Example: range(1, 14, 2) is equivalent to [1, 3, 5, 7, 9,11,13].

                  Program 11: To print your name nine times using for loop with range() function.











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






















                  Program 12: To print multiplication table of an input number.












                  On running the program, we get the following output:

























              134       Premium Edition-VIII
   131   132   133   134   135   136   137   138   139   140   141