Tag

while loop

0 views collected around this technical thread.

Test Development Learning Exchange
Test Development Learning Exchange
Jun 9, 2025 · Fundamentals

Master Python Control Flow: If/Else, For, While & Practical Tips

This article introduces Python control flow, explaining conditional statements (if, elif, else) and loop constructs (for, while) with clear syntax, practical examples, tips, and exercises to help readers master decision‑making and iteration in their programs.

Code ExamplesPythoncontrol flow
0 likes · 7 min read
Master Python Control Flow: If/Else, For, While & Practical Tips
Python Programming Learning Circle
Python Programming Learning Circle
Apr 10, 2024 · Fundamentals

Understanding Loop Structures in Python: for‑in and while Loops

This article explains why loops are needed in programming, introduces Python's for‑in and while loops with practical examples such as summing numbers, generating multiplication tables, guessing games, and solving prime and GCD/LCM problems, and discusses break, continue, and nested loops.

Programmingfor loopfundamentals
0 likes · 9 min read
Understanding Loop Structures in Python: for‑in and while Loops
Architect's Tech Stack
Architect's Tech Stack
Dec 29, 2022 · Fundamentals

Differences Between while(1) and for(;;) in C: Syntax, Execution, and Assembly Comparison

While(1) and for(;;) both create infinite loops in C, but this article explains their syntactic forms, execution semantics, and demonstrates through compiled assembly that they generate identical machine code, highlighting subtle differences and confirming they are functionally equivalent.

C++Infinite LoopSyntax
0 likes · 5 min read
Differences Between while(1) and for(;;) in C: Syntax, Execution, and Assembly Comparison
Python Programming Learning Circle
Python Programming Learning Circle
Jul 1, 2022 · Fundamentals

Using Python's Walrus (Assignment) Operator: Benefits, Patterns, and Practical Examples

This article explains the Python 3.8 walrus (assignment) operator, shows how it can reduce code lines in conditional statements, while loops, list comprehensions, and data‑processing blocks, and discusses its readability impact and practical use cases.

assignment-expressioncode optimizationlist comprehension
0 likes · 6 min read
Using Python's Walrus (Assignment) Operator: Benefits, Patterns, and Practical Examples
Top Architect
Top Architect
May 11, 2022 · Fundamentals

Why Java’s for(;;) Loop Exists and Its Bytecode Equivalence to while(true)

The article explains the origin of Java’s for(;;) infinite loop syntax, compares it with while(true) through source‑code searches and bytecode analysis, and concludes that both constructs compile to identical bytecode, making performance differences negligible while also providing related promotional links.

BytecodeJDKJava
0 likes · 5 min read
Why Java’s for(;;) Loop Exists and Its Bytecode Equivalence to while(true)
Sohu Tech Products
Sohu Tech Products
Dec 22, 2021 · Fundamentals

The Fastest Way to Loop in Python: Using Built‑in Functions and Math Instead of While/For Loops

This article demonstrates that in Python, plain while and for loops are significantly slower than using built‑in functions like sum or applying a direct mathematical formula, because the former execute extra Python‑level boundary checks and increments, making the latter the most efficient looping alternatives.

Pythonbuilt-in functionsfor loop
0 likes · 7 min read
The Fastest Way to Loop in Python: Using Built‑in Functions and Math Instead of While/For Loops
Top Architect
Top Architect
May 30, 2021 · Backend Development

Comparing Java's for(;;) and while(true) Loops and Their Generated Bytecode

The article explains the historical origin of Java's for(;;) loop, compares it with while(true) in terms of readability and bytecode generation, and shows that both constructs compile to identical bytecode in the standard javac compiler, making performance differences negligible.

BytecodeJavafor loop
0 likes · 4 min read
Comparing Java's for(;;) and while(true) Loops and Their Generated Bytecode
Architect's Tech Stack
Architect's Tech Stack
May 16, 2021 · Fundamentals

Why Java’s for(;;) Loop Is Equivalent to while(true) and Its Compilation Details

This article explains the origin of Java’s for(;;) infinite loop syntax, compares it with while(true), shows how both compile to identical bytecode in JDK 8, and concludes that performance differences depend on the JVM implementation rather than the source construct.

BytecodeJDKJava
0 likes · 4 min read
Why Java’s for(;;) Loop Is Equivalent to while(true) and Its Compilation Details
Python Programming Learning Circle
Python Programming Learning Circle
Mar 27, 2021 · Fundamentals

Understanding Python while Loops: Syntax, Variants, and Control Statements

This article explains Python's while loop syntax, including basic usage, the rarely used while‑else construct, infinite loops, and how break and continue statements affect loop execution, supplemented with clear code examples and a concise summary of loop behavior.

Programmingbreakcontinue
0 likes · 5 min read
Understanding Python while Loops: Syntax, Variants, and Control Statements
Practical DevOps Architecture
Practical DevOps Architecture
Mar 10, 2021 · Fundamentals

Python Control Flow: if‑elif‑else, while, and for Loops

This article explains Python's core control‑flow constructs—if‑elif‑else, while, and for loops—providing clear explanations, runnable code examples, and additional notes on boolean logic and string formatting for beginners and intermediate programmers.

Pythoncontrol flowfor loop
0 likes · 4 min read
Python Control Flow: if‑elif‑else, while, and for Loops
Architect's Tech Stack
Architect's Tech Stack
Dec 7, 2019 · Fundamentals

Why Java’s for(;;) and while(true) Loops Have No Performance Difference

The article explains that the infinite loop constructs for(;;) and while(true) in Java originate from C, discusses their syntax and usage, and shows through bytecode inspection that both compile to identical instructions, resulting in no measurable performance gap.

BytecodeJavafor loop
0 likes · 4 min read
Why Java’s for(;;) and while(true) Loops Have No Performance Difference