Computer Science

What are endless loops ? Why do such loops occur?

Python Control Flow

15 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

8 Likes


Related Questions