Infinite Loop

noun

say it: “IN-fih-nit loop” /ˈɪnfɪnɪt lup/

A loop that never stops, usually because its condition never becomes false; Ctrl+C stops a program stuck in one.

What is an infinite loop?

An infinite loop never stops, usually because its condition never becomes false. Press Ctrl+C to stop a program stuck in one.

count = 0
while count < 5:
    print(count)
    # oops: forgot count += 1, so this never ends

In a sentence

  • “Forgetting count += 1 made an infinite loop.”
  • “A while True loop is an infinite loop unless something inside it breaks out.”

Level: Apprentice · More Python terms at this level

Updated

In other subjects