Discussion on Week 2's Topic

Why we use loops in python?

Why we use loops in python?

by Rifat Bin Rabiul -
Number of replies: 0

The looping simplifies the complex problems into the easy ones. It enables us to alter the flow of the program so that instead of writing the same code again and again, we can repeat the same code for a finite number of times. For example, if we need to print the first 10 natural numbers then, instead of using the print statement 10 times, we can print inside a loop which runs up to 10 iterations.