Tagged articles
Loops
88 articles · Page 1 of 1
This tutorial walks through two Java examples—a simple Caesar‑style encryption/decryption program that shifts letters by four positions and a nested‑loop implementation of the 9×9 multiplication table—explaining the logic, code, and output step by step.
JavaLoopsencryption
0 likes · 8 min read

This tutorial explains Java's jump statements—break, continue, and the labeled break—showing their syntax, how they affect single and nested loops, and best‑practice considerations through concrete code examples and execution results.
JavaLoopsbreak statement
0 likes · 9 min read

This article explains step‑by‑step how to use both while‑loops and for‑loops in Python to generate a formatted 9×9 multiplication table, detailing the loop logic, code syntax, and the exact output produced for each row.
LoopsPythonfor loop
0 likes · 10 min read

This note explains Python's while loop, detailing its three-part structure, special considerations such as the one‑time initial condition, lack of ++/-- operators and do‑while syntax, and provides a concrete example that prints "hello world" ten times.
LoopsPythoncontrol flow
0 likes · 3 min read

This tutorial uses kitchen, traffic‑light, and conveyor‑belt analogies to demystify Go's variable declarations, if statements with pre‑statements, the versatile for loop, multi‑value functions, and slice mechanics, providing clear code examples and practical pitfalls for beginners.
ConditionalsGoLoops
0 likes · 6 min read

This short tutorial shows how to draw an ASCII Christmas tree in the console using just six lines of Python code, explaining each variable, the loop logic, and how to add a simple trunk.
ASCII artConsole outputLoops
0 likes · 3 min read

This guide walks you through PHP's core logical structures—sequential execution, conditional statements like if/else and switch, and looping constructs such as for, while, and do‑while—providing clear syntax explanations and practical code examples for each.
Code ExamplesLoopsconditional statements
0 likes · 5 min read

This article examines the performance drawbacks and limitations of JavaScript's forEach method and presents faster alternatives such as classic for loops, for…of, functional methods like map, filter, reduce, and early‑exit methods like some and every.
Array MethodsJavaScriptLoops
0 likes · 3 min read

Learn the three core C++ loop structures—for, while, and do-while—including their syntax, practical examples, control statements like break and continue, plus common pitfalls to avoid for reliable programming.
C++Loopscontrol statements
0 likes · 6 min read

This article compares traditional for loops with modern JavaScript iteration methods such as for…of, forEach, map/filter/reduce, and offers practical performance optimizations, helping developers write clearer, more efficient code.
ES6JavaScriptLoops
0 likes · 5 min read

This article explains Python's flow control constructs—including conditional statements (if, elif, else), loops (for, while), and control statements (break, continue, pass)—with clear explanations and practical code examples to help readers write logical, efficient programs.
Flow ControlLoopsPython
0 likes · 6 min read

This article explains why the JavaScript Array.forEach method is often slower than traditional for or for...of loops, outlines its performance drawbacks, compares it with other iteration techniques, and shows when its simplicity might still make it a suitable choice.
JavaScriptLoopsforeach
0 likes · 5 min read

Modern JavaScript developers increasingly replace traditional for‑loops with expressive array methods, generators, and functional patterns because loops risk scope leakage, mutable state, and off‑by‑one errors, while still using classic loops only for performance‑critical or low‑level tasks, choosing the style that fits data size, team preferences, and project requirements.
Array MethodsJavaScriptLoops
0 likes · 8 min read

The article explains why traditional JavaScript for‑loops are increasingly avoided, outlines modern alternatives such as array methods, generators, transducers and observables, presents performance benchmark findings, and offers guidance on when each iteration technique is appropriate for developers.
Array MethodsJavaScriptLoops
0 likes · 7 min read

This article introduces Python's built‑in range() function, explains its syntax and parameters, and provides ten clear code examples that demonstrate basic counting, custom start‑stop values, step sizes, reverse iteration, list creation, summation, string traversal, bulk list updates, 2‑D coordinate generation, and spaced element access.
LoopsPythoniteration
0 likes · 7 min read

This article presents five distinct Python solutions for calculating the alternating sum 1‑2+3‑4+…+99, illustrating approaches from basic loops with separate counters to concise one‑liners using itertools and generator expressions, and explains why each method satisfies the problem’s requirement of accumulating results in a single variable.
ArithmeticCode ExamplesLoops
0 likes · 5 min read

This comprehensive guide walks you through the fundamentals of Linux shell scripting, covering why it matters, essential prerequisites, variable handling, string manipulation, arithmetic operations, condition testing, control structures like if/else, for/while loops, functions, case statements, and array usage, all with clear examples and practical code snippets.
LinuxLoopsarrays
0 likes · 34 min read

The article showcases a collection of JavaScript snippets—ranging from simple if‑statement drills and password handling tricks to messy loop structures and formatting quirks—illustrating typical beginner mistakes and how to spot and improve them.
If StatementsJavaScriptLoops
0 likes · 3 min read

This article demonstrates a collection of straightforward Python performance tricks—such as list comprehensions, external length calculation, set usage, loop skipping, code inlining, generators, map(), memoization, vectorization, filterfalse, and string joining—that together can accelerate for‑loops from modest 1.3× gains to dramatic 970× speed‑ups, with detailed benchmark results and code examples.
Loopsbenchmarkingcode
0 likes · 15 min read

This article presents ten practical Python code examples that illustrate conditional statements, loops, list comprehensions, and exception handling, helping readers master the core flow‑control constructs essential for writing clear and efficient programs.
Exception HandlingFlow ControlLoops
0 likes · 5 min read

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.
Loopsfor loopfundamentals
0 likes · 9 min read

This article analyzes why Python's while and for loops are relatively slow, benchmarks their execution times with timeit, demonstrates how additional operations further degrade performance, and shows that using built‑in functions like sum or a direct mathematical formula can accelerate the same computation by orders of magnitude.
LoopsSumfundamentals
0 likes · 8 min read

This article explains how Java's break and continue statements work, demonstrates why a simple break cannot exit nested loops, and shows how to use labeled break (and similarly labeled continue) to terminate all loops at once with clear code examples.
ContinueJavaLoops
0 likes · 4 min read

This article introduces PHP’s logical structures—including sequential execution, selection statements like if, if‑else, and switch, as well as loop constructs such as for, while, and do‑while—providing syntax explanations and practical code examples for each.
BackendControl structuresLoops
0 likes · 6 min read

This article outlines key PHP performance optimization strategies—including caching with Memcache or Redis, using efficient database access via PDO, selecting optimal loop constructs like foreach and array_map, and avoiding redundant function calls—to improve execution speed and user experience.
CachingLoopsPHP
0 likes · 5 min read

This article explains the purpose of loops in programming and provides detailed PHP examples of while and do...while constructs, including syntax, step‑by‑step code samples, and important behavior notes such as condition evaluation timing.
BackendLoopsdo-while
0 likes · 4 min read

This article explains why loops are needed in programming, introduces Python's for‑in and while loops, demonstrates their syntax with practical examples—including range variations, break/continue statements, and nested loops such as the multiplication table—and provides exercises on prime checking and GCD/LCM calculation.
LoopsPythonfor
0 likes · 9 min read

This guide introduces Bash scripting fundamentals, covering variable declaration, printing with echo and printf, comments, user input, arrays, conditional statements, loops, functions, and tips for extending scripts with other languages, enabling readers to automate tasks on Unix-like systems.
Loopsautomationfunctions
0 likes · 8 min read

This article explains several methods to break out of nested loops in Python, including using identical break conditions, flag variables, raising exceptions, combining else clauses, and leveraging function returns, illustrated with a prime-number game example and complete code snippets.
Exception HandlingLoopsPython
0 likes · 6 min read

This article presents a series of beginner‑level Python exercises—including a login system with limited attempts, a number‑guessing game, grade classification logic, a rock‑paper‑scissors simulator, and a simple shopping‑cart program—complete with full source code and step‑by‑step explanations.
ConditionalsLoopsbeginner
0 likes · 9 min read

Learn Python's fundamental control flow constructs—including if, if‑else, elif‑else, for and while loops, continue, break, range, and list comprehensions—through clear explanations and interactive code examples that demonstrate condition evaluation, iteration, and common patterns for managing program logic.
LoopsPythoncontrol flow
0 likes · 7 min read

The article explains how higher‑order functions such as every, map, and filter can replace repetitive loops over arrays or lists, reducing code duplication, improving readability, and lowering the chance of bugs while warning against over‑using functional style when it harms clarity.
JavaScriptLoopscode reuse
0 likes · 3 min read

This article presents a Python fan's arithmetic challenge—calculating the alternating sum 1‑2+3‑4+…+99—and walks through five distinct code solutions, from basic loops to concise itertools one‑liners, highlighting their logic and trade‑offs.
AlgorithmCode ExampleLoops
0 likes · 5 min read

This article explains several Python techniques—using identical break conditions, flag variables, exceptions, loop‑else clauses, and function returns—to exit nested loops, demonstrated through a prime‑number game where the program stops when a non‑prime input is entered.
Exception HandlingLoopsPython
0 likes · 6 min read

This article explains MySQL's experimental EXPLAIN FORMAT=TREE feature and the later EXPLAIN ANALYZE extension, showing how they present execution plans, estimated costs, actual runtime metrics, and how to interpret the tree output for query optimization.
EXPLAINLoopsMySQL
0 likes · 5 min read

The article explains the syntax and semantics of while(1) and for(;;) infinite loops in C, compares their generated assembly code, and demonstrates through compiled examples that both constructs produce essentially identical machine code despite minor semantic differences.
C++CompilerLoops
0 likes · 4 min read

This article explains the syntax, execution flow, and practical differences between the C constructs while(1) and for(;;), demonstrating through compiled assembly that both produce identical code for an empty infinite loop under typical compiler settings.
CompilerLoopsassembly
0 likes · 5 min read

The article examines the origins and practical equivalence of Java’s infinite loop constructs for(;;) and while(true), showing through JDK8u source searches and javac bytecode that both compile to identical code and have no performance difference.
JDK8Loopscompilation
0 likes · 5 min read

An exploration of Java’s infinite loop constructs reveals that for(;;) originates from C, offers a concise syntax without magic numbers, and, according to bytecode analysis of JDK8u, performs identically to while(true), with performance determined solely by the JVM implementation.
JavaLoopsbytecode
0 likes · 4 min read

This article introduces fundamental Python programming concepts by using everyday analogies, covering what code is, conditional statements, loops, variables, functions with parameters, modules, and classes, and provides clear example code snippets to illustrate each topic for beginners.
ClassesConditionalsLoops
0 likes · 15 min read

This article provides a comprehensive guide to Bash scripting, covering if/elif/else conditionals, case statements, four types of loops (for, while, until, select), signal trapping with trap, useful one‑liners for randomness and colored output, and several fun scripts such as a multiplication table, colored triangle, and chessboard.
ConditionalsLoopsbash
0 likes · 14 min read

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.
JavaLoopsbytecode
0 likes · 4 min read

This article provides a comprehensive guide to Bash scripting, covering conditional statements (if/elif/else), case selections, various loop constructs (for, while, until, select), loop control commands, parameter shifting, signal trapping with trap, and includes numerous practical code examples with detailed analysis.
ConditionalsLoopsSignal Handling
0 likes · 17 min read

This guide provides a comprehensive walkthrough of Bash scripting fundamentals, covering conditional statements, various loop constructs, signal handling with trap, and a collection of useful one‑line scripts and visual examples for everyday tasks.
ConditionalsLoopsbash
0 likes · 14 min read

This article provides a detailed Bash scripting tutorial covering conditional statements (if/elif/else, case), various loop constructs (for, while, until, select), control commands (break, continue, shift), signal handling with trap, and several practical example scripts such as a multiplication table, colored triangle, and chessboard pattern.
ConditionalsLoopsSignal Handling
0 likes · 16 min read

This tutorial walks through the complete design and implementation of a Hangman word‑guessing game in Python, covering library imports, variable declarations, hidden‑word generation, the main game loop, input handling, guess validation, life‑count management, repeated‑guess detection, win/lose conditions, and output clearing within a Jupyter Notebook environment.
Jupyter NotebookLoopsTutorial
0 likes · 12 min read

This article explains the purpose, syntax, and practical usage of Python's for loop, covering iteration over lists, strings, ranges, conditional filtering, loop control statements, list comprehensions, and real‑world examples with complete code snippets.
LoopsTutorialfor loop
0 likes · 7 min read

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.
ContinueLoopsbreak
0 likes · 5 min read

This article compares the performance of common JavaScript looping constructs—including for, reverse for, forEach, for...of, for...in, and for...await—provides benchmark code on a million‑element array, explains the speed differences, and offers guidance on choosing the right loop for readability and maintainability.
JavaScriptLoopsbenchmark
0 likes · 7 min read

This article presents ten practical low‑level optimization strategies—ranging from reducing computational workload and extracting common subexpressions to loop unrolling, accumulator parallelism, and conditional‑move coding—each illustrated with C examples, detailed analysis, and before‑after performance comparisons.
C++Loopsassembly
0 likes · 18 min read

This tutorial explains how to design a PHP‑based student information management system by covering array fundamentals, different array types, looping statements, and provides complete code examples for defining student data, iterating with for and foreach loops, and rendering the results in an HTML table.
LoopsStudent ManagementTutorial
0 likes · 6 min read

With Selenium IDE 4, testers can overcome flaky UI tests caused by locator changes by recording multiple element selectors, and can also script complex scenarios using built‑in loop and conditional commands, making automated testing more robust and flexible.
Conditional LogicIDELoops
0 likes · 4 min read

This article introduces several Python iteration tricks—including zip for parallel loops, C‑style range loops, filter for selective processing, enumerate for indexed iteration, and sorted for ordering data—providing concise code examples that make loops more efficient and readable.
LoopsPythonenumerate
0 likes · 7 min read

This article introduces Python's basic syntax, execution order, coding conventions, common operators, input/output handling, conditional statements, ternary expressions, and loop structures, and demonstrates a simple dice‑guessing game that highlights the use of break and continue.
LoopsPythoncontrol flow
0 likes · 11 min read

This article provides a comprehensive guide to Bash programming, covering variable types and naming rules, assignment and quoting, environment and positional variables, arithmetic and logical operations, conditional statements, loops, functions, arrays, string manipulation, signal handling, and essential command‑line utilities for Linux system scripting.
LinuxLoopsbash
0 likes · 24 min read

This guide shows how to reliably collect user input in Python by placing the input call inside a while loop, using continue and break for flow control, handling parsing errors with try/except, and adding custom validation functions for robust data entry.
Loopsfunctionsinput validation
0 likes · 7 min read

This tutorial introduces Python as a high‑level, readable language, explains why it’s popular for web, data science and AI, and walks through core fundamentals such as variables, if/elif/else statements, while and for loops, lists, dictionaries, and iteration with clear code examples.
DictionariesLoopsPython
0 likes · 9 min read

While relearning Java, the author created a concise solution that uses a single if‑else check to print both a right‑aligned and an equilateral triangle in the console, reducing the usual multiple‑loop approaches and providing complete code examples with output images.
Console outputJavaLoops
0 likes · 3 min read

This tutorial introduces Python by defining the language, explaining why it’s popular, and walking through core fundamentals such as variables, conditional statements, loops, lists, dictionaries, classes, encapsulation, getters/setters, and inheritance with clear code examples.
LoopsOOPbasics
0 likes · 18 min read

This tutorial explains Python list comprehensions, showing how to replace traditional for‑loops with concise one‑line expressions for generating simple, filtered, nested, and transformed lists, complete with clear code examples and step‑by‑step explanations.
LoopsTutoriallist comprehension
0 likes · 5 min read

This comprehensive guide walks you through Python fundamentals—from defining variables and using conditional statements to mastering loops, lists, dictionaries, and object‑oriented programming concepts—providing clear examples and code snippets to help beginners build a solid coding foundation.
Loopsbasicsdata-structures
0 likes · 18 min read

The article explains how loops enable repeated execution of code, describes common loop types such as while, do‑while, and for, outlines Scala’s loop control statements, and provides an example of an infinite while loop in Scala.
LoopsScalacontrol flow
0 likes · 3 min read

This article gathers subtle yet frequent anti‑patterns that new Python developers encounter—misusing range, avoiding list comprehensions, overlooking set/dict look‑ups, variable‑scope surprises, and PEP8 style rules—and offers clear, practical alternatives to write cleaner, faster, and more maintainable code.
Loopsbest-practicescoding standards
0 likes · 10 min read


21CTONov 17, 2018 · Operations
This guide explains what Shell scripts are, their practical uses and limitations, the underlying interpreter mechanism, and provides step‑by‑step examples covering variables, arithmetic and relational operators, strings, arrays, input/output, conditionals, loops, functions, redirection, and automation scripts such as a Git commit helper.
Loopsbashshell
0 likes · 10 min read

This comprehensive guide walks you through Python fundamentals, covering variable assignment, data types, conditional statements, loops, list and dictionary operations, as well as class definitions, object instantiation, encapsulation, and inheritance, all illustrated with clear code examples.
LoopsPythonTutorial
0 likes · 18 min read

This guide walks you through Bash scripting fundamentals, covering conditional statements (if, case), four loop types (for, while, until, select), loop control commands (continue, break, shift), signal trapping with trap, plus practical examples and handy one‑liners for automation.
ConditionalsLoopsbash
0 likes · 12 min read

This tutorial presents a collection of Bash scripts demonstrating how to calculate sums with for, while, and until loops, compute the sum of even numbers, generate a 9×9 multiplication table, monitor user login status, and retrieve system information via a case menu.
Loopsbashshell-scripting
0 likes · 5 min read

This article explains why loop statements exist, outlines Python's for and while loops (noting the absence of do‑while), compares loop types, and details Python's loop control statements—break, continue, and pass—providing a concise foundation for writing efficient repetitive code.
LoopsPythoncontrol statements
0 likes · 3 min read


ITPUBMay 25, 2018 · Fundamentals
This tutorial explains programming fundamentals using everyday analogies, covering how code serves as a precise language for computers, the role of conditionals, loops, variables, functions, modules, and an introduction to classes, all illustrated with Python examples that model buying fruit under different scenarios.
ClassesConditionalsLoops
0 likes · 16 min read

This comprehensive guide walks you through the essentials of Bash shell scripting, covering variable definitions, printing, arithmetic, control structures, loops, arrays, functions, file I/O, sed stream editing, modular scripts, and interactive menus, all illustrated with clear code examples.
Loopsbashfile handling
0 likes · 24 min read

This tutorial introduces Python's core philosophy and syntax, covering variables, conditional statements, loops, lists, dictionaries, and object‑oriented concepts such as classes, encapsulation, and inheritance, providing ready‑to‑run code examples for each topic.
LoopsOOPfundamentals
0 likes · 17 min read

This tutorial introduces the fundamentals of programming with Python, explaining what code is, how to use conditionals, loops, variables, functions, parameters, modules, and classes, and provides clear examples that illustrate each concept for beginners.
ClassesConditionalsLoops
0 likes · 15 min read

This article provides a beginner-friendly guide to shell scripting, covering script creation, variable definitions, read‑only and unset variables, string handling with quotes, echo usage, conditional if‑else statements, for and while loops, and two methods for executing scripts, all illustrated with clear code examples.
LinuxLoopsshell
0 likes · 5 min read

The article presents Raymond Hettinger's PyCon 2013 notes on writing Pythonic code, covering loops, collections, dictionary handling, performance tips, context managers, and best practices, with examples and improved alternatives to help developers write clear, efficient, and idiomatic Python.
LoopsPythoncollections
0 likes · 15 min read


21CTOJan 14, 2018 · Fundamentals
This tutorial walks you through Python's for loops, iterating over lists and dictionaries, demonstrates key-value access, explores class definitions, constructors, getters, setters, and property decorators, and shows how to create and manipulate objects with clear code examples.
ClassesDictionariesLoops
0 likes · 8 min read


21CTOJan 13, 2018 · Fundamentals
This tutorial introduces Python fundamentals, covering variables, conditional statements, while and for loops, list operations, and dictionary usage, with clear explanations and code examples to help beginners quickly start programming in Python.
DictionariesLoopscontrol flow
0 likes · 10 min read

This guide demonstrates how to define a Python list, print its contents, and iterate over each element using both a for‑loop and a while‑loop, including step‑by‑step code explanations and common pitfalls such as infinite loops and type conversion.
ListLoopsPython
0 likes · 4 min read

This guide reveals Pythonic techniques for iterating over ranges, lists, dictionaries, and multiple collections, showing how to write concise, readable loops, use built‑in functions like zip and enumerate, and apply advanced tools such as defaultdict, ChainMap, and context managers for cleaner and faster code.
Best PracticesLoopsPython
0 likes · 16 min read


21CTOOct 13, 2017 · Fundamentals
This comprehensive tutorial walks you through Python fundamentals—from defining variables, booleans, strings, and numbers to using conditional statements, while and for loops, manipulating lists and dictionaries, and building classes with objects, encapsulation, and inheritance—providing clear code examples for each concept.
Loopscontrol flowdata structures
0 likes · 19 min read

This comprehensive guide walks you through Bash scripting fundamentals, covering conditional statements (if, case), four types of loops (for, while, until, select), loop control commands, signal trapping with trap, useful one‑liners, and a collection of fun mini‑scripts, all illustrated with clear examples and diagrams.
ConditionalsLinuxLoops
0 likes · 11 min read

This article introduces shell scripting fundamentals, explores practical use cases, explains how the shell works, demonstrates variables, operators, control structures, functions, redirection, and provides example scripts for automating tasks on Windows, Unix, and Linux systems.
Loopsbashfunctions
0 likes · 6 min read

This article explains Python's conditional and loop statements—including if, elif, else, while, for, break, continue, and pass—detailing their syntax, logical operators, execution flow, and visual diagrams, while also showing practical code examples and output illustrations to help beginners master control structures.
LoopsPythonconditional statements
0 likes · 8 min read

This article explains Python’s while loop syntax, how conditions control execution, the use of continue, break, and else clauses, demonstrates infinite loops, and provides visual flowcharts and code examples to help readers grasp loop control structures effectively.
LoopsPythoncontrol flow
0 likes · 4 min read

This article introduces Python's loop constructs, detailing the differences between for and while loops, how to nest loops, and the use of control statements like break, continue, and pass to manage loop execution flow.
Loopscontrol statementsfor loop
0 likes · 3 min read

Learn how to use Bash's flow-control structures—including if, elif, else, case, for, and while loops—through clear explanations and practical code examples that demonstrate testing conditions, handling files, and automating tasks in shell scripts.
ConditionalsLoopsbash
0 likes · 6 min read

This article presents 25 concise questions and answers covering fundamental shell scripting concepts—including script creation, variables, redirection, control structures, debugging, and common commands—providing Linux administrators with a quick reference guide to write and manage effective Bash scripts.
LoopsRedirectionshell-variables
0 likes · 12 min read

This article walks through the fundamentals of Bash scripting, covering file descriptors, input/output redirection, here‑documents, combining stdout and stderr, pipe lines, the tee command, and the three main loop constructs with practical examples and tips for effective shell programming.
ConditionalsLoopsio redirection
0 likes · 21 min read

This article explains how Python's range(), enumerate() and zip() functions can be combined to create more flexible loops, allowing iteration by index, simultaneous access to indices and elements, and parallel traversal of multiple sequences.
Loopsenumeraterange
0 likes · 4 min read
