About 9,400,000 results
Open links in new tab
  1. Python: How can I use a for loop to execute my code 5 times?

    Feb 6, 2020 · Run the program five times using the provided first values and your chosen second values, and check your results. You can alternatively run the program once and use a for loop …

  2. SOLVED: How to loop n times in Python [10 Easy Examples]

    Aug 7, 2022 · First one is to iterate over the sequence like List, Tuple, Set and Dictionary. And the other one is to iterate over the range of numbers. This version of for loop will iterate over a …

  3. Python For Loops - W3Schools

    To loop through a set of code a specified number of times, we can use the range () function, The range () function returns a sequence of numbers, starting from 0 by default, and increments by …

  4. Python for Loop (With Examples) - Datamentor

    Here, we have used the loop to print 'Running for Loop' 5 times using the range(1, 6) function. In this case, the range() function will create a sequence of numbers from 1 to 5 (the second value …

  5. Python program to print Your name 5 times on the screen

    Write a program to print your name 5 times on the screen . Sample Output. The objective of the code is to print the name 5 times on the screen . Code (Python):- Output:- Find the number of …

  6. How to loop N times in Python - sebhastian

    Apr 3, 2023 · Looping for N times in Python can be done using both the for and while loops. This tutorial will show you how to use both loops in practice. 1. Loop N times using the for loop. The …

  7. For Loops in PythonFor Loop Syntax Example

    Jan 18, 2023 · To start the for loop, you first have to use the for keyword. The placeholder_variable is an arbitrary variable. It iterates over the sequence and points to each …

  8. Write a program to in python to print your name five times

    Feb 3, 2021 · Write a program in Python to print your name 5 times. Here comes the program. 1. Using loop. print ("My name is abcd.") 2. Without using loop. When strings are multiplied with …

  9. Python for loop - PYnative

    Dec 28, 2022 · In Python, the for loop is used to iterate over a sequence such as a list, string, tuple, other iterable objects such as range. With the help of for loop, we can iterate over each …

  10. python - How do I ask for a users name and display it thrice using the ...

    Sep 20, 2021 · So, we'll use range(3) to do so. The loop will run print(name) three times because of range(3), resulting in the name being printed thrice. If you'd like to print it five times, you'd …

  11. Some results have been removed
Refresh