About 236,000 results
Open links in new tab
  1. Python For Loops - W3Schools

    A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string). This is less like the for keyword in other programming languages, and works more like …

  2. ForLoop - Python Wiki

    for loops are used when you have a block of code which you want to repeat a fixed number of times. The for-loop is always used in combination with an iterable object, like a list or a range. …

  3. How To Use The Repeat () Function In Python?

    Jan 4, 2025 · Learn how to use Python's `repeat ()` function from the `itertools` module! This tutorial covers syntax, examples, and tips for repeating values in loops.

  4. Loops in Python - For, While and Nested Loops - GeeksforGeeks

    Oct 4, 2025 · Loops in Python are used to repeat actions efficiently. The main types are For loops (counting through items) and While loops (based on conditions). For loops is used to iterate …

  5. python - How do I write a loop to repeat the code? - Stack Overflow

    I am a very beginner in Python and I want to repeat this code. But I don't really know how to do this without "goto". I tried to learn about loops but did not understand how to apply them.

  6. How to Repeat Code N Times in Python - Delft Stack

    Feb 14, 2021 · This article discusses five distinct methods to repeat a specific operation a predetermined number of times in Python, ranging from classic for loops to more advanced …

  7. How to repeat a function N times or indefinitely in Python

    Feb 16, 2023 · To repeat a function N times in Python, you need to use the for loop and range function. Suppose you have a function that asks for a number and then multiple that number …

  8. How Do You Repeat Actions or Loops in Python?

    Learn how to repeat actions in Python with easy-to-follow examples and tips. This guide covers loops, list comprehensions, and string repetition techniques for efficient coding.

  9. Loops and Loop Control - OpenPython

    Loops are one of the most powerful tools in Python. They let you repeat blocks of code without writing them out multiple times. You’ll typically use: for loops — when you want to go through …

  10. Python For Loop and While LoopPython Land Tutorial

    Sep 5, 2025 · Another way to control the flow is by using a Python for-loop or a Python while-loop. Loops, in essence, allow you to repeat a piece of code. There are two ways to create a loop in …