Infinite loop
An infinite loop is a control-flow cycle that continues without reaching a normal termination point unless an exit condition or external intervention stops it.
Python Workout: 50 ten-minute exercises
A loop whose condition remains true until an explicit control-flow operation exits it.
- How it is used
- Uses repeated interactive input until a correct answer, valid record, or explicit break ends processing.
- How deep it goes
- Explains while True, break, continue, validation, and input conversion through two worked interactive programs.
- Examples
- Demonstrates number guessing with random.randint and rainfall collection with dictionary updates.
- What you can do after
- Apply it via Python to build interactive loops with explicit exits and retry paths for invalid input.
Read how Python Workout: 50 ten-minute exercises explains infinite loop →
100 Java Mistakes and How to Avoid Them
An infinite loop is a loop whose execution continues indefinitely because its termination condition is never reached or satisfied.
- How it is used
- Warns against loop constructs that fail to make progress or reach a terminating condition.
- How deep it goes
- Explains counter mix-ups, idempotent bodies, overflow, tests, fixes, and static-analysis limits without broader overflow internals.
- Examples
- Uses nested counters, unique-ID suffix generation, format-string scanning, array normalization, and inclusive maximum-bound iteration.
- What you can do after
- Diagnose/debug with it by tracing whether each iteration changes termination-relevant state and testing maximum-bound corner cases.
Read how 100 Java Mistakes and How to Avoid Them explains infinite loop →
Python Workout, Second Edition
An infinite loop is a loop whose condition remains true so that execution continues until an explicit exit changes the control flow.
- How it is used
- Deploys repeated user interaction for guessing games and accumulating rainfall data until an explicit termination event occurs.
- How deep it goes
- Explains while True, break, continue, input conversion, and a transformation-related failure mode, but stops short of loop internals.
- Examples
- Uses a number-guessing loop, a rainfall dictionary tracker, and a Ubbi Dubbi character transformation.
- What you can do after
- Apply it via Python while True, break, and continue to build interactive loops with explicit termination and input validation.
Read how Python Workout, Second Edition explains infinite loop →
Also covered in
- Get Programming: Learn to code with Python
- The Well-Grounded Rubyist, Fourth Edition
- 100 C++ Mistakes and How to Avoid Them
- Architecting Autonomous Agentic SystemsIn early access (MEAP)
- AI GovernanceIn early access (MEAP)
- Build Your Own Robot: Using Python, CRICKIT, and Raspberry Pi
- Build Python Web Apps with Streamlit
- Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools
- Tiny Python Projects: Learn coding and testing with puzzles and games
What to know first
- loopA loop is a programming-language control-flow construct that repeatedly executes a block of instructions according to an iteration rule or continuation condition.
- PythonPython is a high-level, general-purpose, dynamically typed programming language with readable syntax and support for multiple programming paradigms.
- listA list is an ordered collection of elements arranged in a sequence.
- stringA string is a programming-language value representing textual data as an ordered sequence of characters or encoded units.
Related concepts
- loopimplemented by · A loop is a programming-language control-flow construct that repeatedly executes a block of instructions according to an iteration rule or continuation condition.
- do-while loopproduced by · A do-while loop is a control-flow construct that executes its body before testing a condition, then repeats while the condition is true.
- st.rerunuses · st.rerun is a Streamlit API function that stops the current script execution and starts a new execution from the beginning.
Questions about infinite loop
What is infinite loop?
An infinite loop is a control-flow cycle that continues without reaching a normal termination point unless an exit condition or external intervention stops it.
Which Manning books explain infinite loop?
Python Workout: 50 ten-minute exercises, 100 Java Mistakes and How to Avoid Them and Python Workout, Second Edition.
What should I know before learning infinite loop?
Manning books that teach infinite loop usually introduce loop, Python, list and string first.
What is the difference between infinite loop and intrinsics::abort?
An infinite loop is a control-flow cycle that continues without reaching a normal termination point unless an exit condition or external intervention stops it. The Rust abort intrinsic immediately terminates program execution without performing normal unwinding or cleanup.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


