Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 128 - 2609_Logicode
P. 128

    On running the above program, you will get the following output:

                      Program: To add first five natural numbers.

                      On running the above program, you will get the following output:

                           REVISIT

                        ▶  The statements that are used to repeat a set of instructions are called iterative or looping statements.

                        ▶  Python provides two types of looping statements—for and while.
                        ▶  The for statement executes a simple or compound statement for a fixed number of times.
                        ▶  The range( ) function is an in-built function of Python.

                        ▶  A sequence is a succession of values bound together by a single name.

                      126   Premium Edition-VIII

| 123 124 125 126 127 128 129 130 131 132 133 |