About 263,000 results
Open links in new tab
  1. Conditional Statements in Python - GeeksforGeeks

    Apr 4, 2025 · Conditional statements in Python are used to execute certain blocks of code based on specific conditions. These statements help control the flow of a program, making it behave …

  2. Python Conditional Statements and Loops

    Read all the tutorials related to the topic of Python Sets. Loops in Python. Loops allow you to execute a block of code multiple times. Python provides two main types of loops: for loops and …

  3. If x < 5, print “The number is less than 5.” 5 and 10.” Otherwise, print “The number is at least 10.” Prompt user to input a timer value in seconds, store as t. Display “Time’s up!”

  4. Python Conditions - W3Schools

    Python supports the usual logical conditions from mathematics: These conditions can be used in several ways, most commonly in "if statements" and loops. An "if statement" is written by using …

  5. 4. Conditionals, loops and exceptions — Beginning Python

    In Python the keywords if, elif, and else are used for conditional statements. counter ¶ A variable used to count something, usually initialized to zero and incremented in the body of a loop.

  6. 1.3 Conditionals and Loops - Princeton University

    Many loops follow the same basic scheme: initialize an index variable to some value and then use a while loop to test an exit condition involving the index variable, using the last statement in …

  7. Loops and Conditional Statements — Python Tutorials …

    Loops and conditional statements are very common elements of scripts. These structures allow us to specify what should happen when a particular condition is satisfied or not. 1. Formulating …

  8. A Beginner's Python Tutorial/Loops, Conditionals - Wikibooks

    Aug 8, 2022 · The following are examples of a type of loop, called the while loop: How does this program work? Let's go through it in English (this is called pseudocode): Make 'a' one larger …

  9. Conditional statements in Python — pyOpenSci Lessons

    This lesson introduces Python conditional statements which can be used to control the flow of code by executing code only when certain conditions are met. Why Use Conditional …

  10. Python: Conditional Statements and Loops - Medium

    Apr 27, 2023 · In this article, we will explore the various types of conditional statements and loops available in Python, along with examples to help illustrate their usage. Conditional statements...

Refresh