Loops
An introduction to looping in Python.
We'll cover the following
In a programming language, we sometimes need to execute statements x number of times. We don’t want to write the same programming statement x times, as doing so would make the code unreadable. Also, if we want to change something, we would have to change each block of code. That’s why looping is necessary.
Definite and indefinite iterations
Iteration can be definite or indefinite. Definite iterations are repeated a specific number of times, while indefinite iterations are repeated until a condition is met.Level up your interview prep. Join Educative to access 80+ hands-on prep courses.