About 3,060,000 results
Open links in new tab
  1. Print Hello 10 times, in Python - Programming Idioms

    let rec n_hellos (n : int) : unit = if n = 0 then () else (print_endline "Hello"; n_hellos (n-1)) n_hello_worlds 10 Clojure (dotimes [_ 10] (println "Hello"))

  2. While Loop in Python with Examples - Scaler Topics

    Jun 19, 2023 · The best possible approach will be using the while loop statement in Python. And here’s how it works: Write a while loop. Place the print(“Name”) inside the while loop. Write a …

  3. Python While Loops - W3Schools

    Python has two primitive loop commands: With the while loop we can execute a set of statements as long as a condition is true. Note: remember to increment i, or else the loop will continue …

  4. Write a Python Program to Print Your Name 10 Times - Using While Loop

    Hi, in this video I explained about how to Write a Python Program to Print Your Name 10 TimesWrite a Python Program to Print Your Name 10 Times - Using For L...

  5. python - How to print a string multiple times? - Stack Overflow

    Oct 22, 2020 · In my viewpoint, the easiest way to print a string on multiple lines, is the following : print("Random String \n" * 100), where 100 stands for the number of lines to be printed. So I …

  6. 8 Python while Loop Examples for Beginners - LearnPython.com

    Feb 5, 2024 · In this article, we will examine 8 examples to help you obtain a comprehensive understanding of while loops in Python. Example 1: Basic Python While Loop. Let’s go over a …

  7. Python while Loop (With Examples) - Programiz

    In Python, we use a while loop to repeat a block of code until a certain condition is met. For example, print(number) number = number + 1. Output. In the above example, we have used a …

  8. Printing one character at a time from a string, using the while loop

    Sep 19, 2016 · System.out.println(i); This loop will run exactly 10 times. This is just a nicer way to write this: System.out.println(i); i++; //add one to i . The most common usage for a for loop is to …

  9. Python – While Loop – CoderMantra

    Example 2: Python program to print your name 10 times. Example 3: Python program to print 1 to 10 in the same line. We can also use else statement with the loop in Python, when the loop …

  10. How to repeat a while loop a certain number of times

    Jan 13, 2018 · To repeat something for a certain number of times, you may: Use range or xrange. for i in range(n): # do something here Use while. i = 0 while i < n: # do something here i += 1 If …

  11. Some results have been removed
Refresh