About 46,800 results
Open links in new tab
  1. 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. …

  2. 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.

  3. Loops | Python Best Practices – Real Python

    4 days ago · Loops allow you to process collections of data or run a code block multiple times. The Python for loop is designed to iterate directly over iterables and perform an action on each …

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

    Dec 22, 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 …

  5. 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.

  6. Easily Repeat Tasks Using Loops - OpenClassrooms

    To loop through a set of code a certain number of times, you can use the range () function, which returns a list of numbers starting from 0 to the specified end number.

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

    Then use while True to call it infinitely or for i in range(6) to call it 6 times: def repeat(): addr = input() vendor = requests.get('http://api.macvendors.com/' + addr).text. print(addr, vendor) …

  8. How to repeat something in Python - derludditus.github.io

    Beyond the basic for loop pattern, Python provides several powerful repetition tools including while loops, customizable range () parameters, and the multiplication operator for sequence …

  9. 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 …

  10. Enki | Blog - How to Repeat Code in Python

    Repeating code in Python using for loops is both powerful and simple, making your code more readable and maintainable. You can iterate over various data structures such as lists, tuples, …