About 672,000 results
Open links in new tab
  1. 01-conditionals-loops.ipynb - Colab

    Enables logical branching and recoding of data. BUT, if statements can result in long code branches, repeated code. Best to keep if statements short. Keep in mind the Zen of Python …

  2. python - different cells for if elif else in colab - Stack Overflow

    Feb 20, 2021 · I am wondering if there is any way to use if -statement in one cell, then use elif in another cells, then use else in the final cell, in google colab. The reason not to have all code in …

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

  4. Cosi-10a: Introduction to Problem Solving in Python

    An if statement is the most basic conditional statement in Python. It looks like this: statement(s) x > 5 is the test. It must be a boolean expression. print("This print executes when x is greater …

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

    In order to write useful programs, we almost always need the ability to check conditions and change the behavior of the program accordingly. Conditional statements give us this ability. …

  6. Mastering Conditional Statements and Loops in Python

    Jan 24, 2025 · Lesson 3: Conditional Statements and Loops in Python In Python, branching is implemented using the if statement, which is written as follows: if condition: statement1 …

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

  8. conditional_statements.ipynb - Colab

    When we use conditional statements, Python evaluates the logical expression contained within them, in order to determine the value returned by the logical expression.

  9. Introduction to Python - Conditional Statements and Loops

    Conditional Statements and Indentation. The syntax for control structures in Python use colons and indentation. Beware that indentation affects flow. if statemenet enable logic. elif give …

  10. Loops, Conditional Statements and Function | CADS | FSB

    In general, for loops are used when you know exactly how many times you plan to run a loop; a while loop is used when the number of iterations is uncertain. if condition: do things here. …

  11. Some results have been removed
Refresh