Computer Science

What are endless loops ? Why do such loops occur?

Python Control Flow

13 Likes

Answer

A loop which continues iterating indefinitely and never stops is termed as an endless or infinite loop. Such loops can occur primarily due to two reasons:

  1. Logical errors when the programmer misses updating the value of loop control variable.
  2. Purposefully created endless loops that have a break statement within their body to terminate the loop.

Answered By

7 Likes


Related Questions