About 1,680,000 results
Open links in new tab
  1. While loop with if/else statement in Python - Stack Overflow

    Apr 25, 2016 · What a while-loop says is if True, keep doing till False. If you watch automate the boring stuff- While Loops on YouTube it should give you a understanding of how a while loop …

  2. 4. More Control Flow Tools — Python 3.13.3 documentation

    2 days ago · As well as the while statement just introduced, Python uses a few more that we will encounter in this chapter. Perhaps the most well-known statement type is the if statement. For …

  3. Python: For Loops, While Loops and If-Else Statements

    Feb 12, 2024 · This article will explain what is, how to make and use for loops, while loops and if-else statements in Python. A for-loop can be used to iterate through a range of numbers, …

  4. Python Conditional Statements and Loops

    Learn how to use conditional statements in Python with practical examples. Master if, elif, and else statements to control your program's flow and make decisions. ... When creating data …

  5. If condition in while loop in Python | Trepachev Dmitry

    Given an integer, get a list of divisors of this number. In this lesson we will look at working with the if condition in a while loop in Python.

  6. If statements within a while loop (beginner question) - Python

    Jan 28, 2023 · (Y/N): ") if coupon.lower() == "y": has_coupon = True elif coupon.lower() == "n": has_coupon = False print("Too bad LOL") time.sleep(1) if has_coupon: while True: coupon = …

  7. combine while and if else in python 3 - Stack Overflow

    Jul 9, 2018 · import random secret = random.randint(1,10) guess = int(input("guess a number :")) while guess != secret: guess = int(input("wrong, try again:")) if guess == secret: print("6666") …

  8. Python Control Flow: if, else and while Statements

    Sep 29, 2024 · Learn how to use Python control flow with if, else and while statements to build dynamic programs. Master loops, break, continue and real-world applications.

  9. How to use if else, while and for loops in python? - Nomidl

    Jun 5, 2022 · The while loop: A so-called while loop specifies a condition and a block of code to be executed until the condition evaluates to False or a break statement, which we will cover …

  10. Control Flow and Loops in Python – datanovia

    Learn how to control the flow of your Python programs using conditional statements and loops. This tutorial covers if/else statements, for loops, while loops, and best practices for effective …

  11. Some results have been removed
Refresh