Results for “or”

Showing 1–10 of 171

  1. Article Mini projects

    Drawing Planetary Orbits in Python

    Dive into the world of planetary orbits using Python's Turtle library. Discover how orbital eccentricity shapes cosmic paths, from Earth's near-circular orbit to a comet's elliptical journey. Code…

  2. Challenge

    One orbit short

    A loop over range(1, 10) logs nine orbits of a ten-orbit flight. Predict the last line, find out where range() stops, fix it with ORBITS + 1, then list every third orbit with a range() step.

    Fix the code Easy 3 stages for loop range off-by-one step
  3. Challenge

    Safe mode

    …spacecraft into safe mode when the battery is under 20% or contact has been lost for over 10 minutes, using or, then name the rule that fired with boolean variables and an if/elif chain.

    Write the code Medium 2 stages if elif or and
  4. Challenge

    Upload router

    Route an uploaded file to images, telemetry or rejected by its extension with an if/elif chain and endswith(), then cope with capitals, spaces and more extensions without changing the name that is…

    Write the code Easy 2 stages if elif else or
  5. Challenge

    Round or cut?

    int() cuts the decimals off, round() rounds, and round(2.5) gives 2. Predict the difference, investigate Python's rounding rule, then round a fuel reading two ways.

    Write the code Medium 3 stages int round rounding type conversion
  6. Challenge

    Unreachable branch

    …reading of 63 because its elif conditions are in the wrong order, so CRITICAL can never run. Predict it, find the dead branch, fix the order, then write a four-level chain.

    Fix the code Easy 3 stages if elif order of conditions debugging
  7. Challenge

    Sign-up cleanup

    …lower-case emails, then reject sign-ups with no name or a broken email and drop duplicates by email, saying why for each one.

    Write the code Medium 2 stages project strings strip split