Results for “range”

Showing 11–20 of 21

  1. Article Python Fundamentals

    Nested Loops in Python

    …# Scanning one row of Mars surface for x_position in range(5): print(f"Scanning position X: {x_position}") This gives us: Scanning position X: 0 Scanning position X: 1 Scanning position X: 2 Scanning…

  2. Challenge

    Telemetry pipeline

    …what it can't trust, raise the alarm on what is out of range and leave a summary the dashboard can read. Three stages: validate, flag, save. Validate the rows Read telemetry.csv with csv.DictReader…

    Write the code Hard 3 stages project csv json files
  3. Challenge

    Test the pipeline

    …Add checks for check_limits() : a reading above its range, one below, and one exactly at the upper limit, which is allowed and must give None . Keep the passed line at the end. The hidden tests now…

    Write the code Hard 2 stages project testing assert try
  4. Article Mini projects

    Medical dispenser - Don’t trust the user

    …= 3 # Lower limit for testing for i in range(5): result = quick_dispenser.request_dose() print(f"Dose attempt {i+1}: {result}") if i < 4: # Don't wait after last attempt time.sleep(1.1) print("\n===…

  5. Challenge

    Shift rota

    Build the station's weekly shift rota: three shifts a day, the crew taken in turn so nobody works two shifts in a row, with a check that proves it, then plan around days off while keeping the work…

    Write the code Hard 2 stages project scheduling lists tuples
  6. Challenge

    Seeded simulation

    Simulate 100 sensor readings, each with a 5% chance of a glitch, and seed random with 42 so the count is the same on every run and a test can check it exactly, then pick a kind for each glitch with…

    Write the code Easy 2 stages random random.seed random.choice simulation
  7. Article Mini projects

    Calculating Escape Velocity in Python

    …/ radii) print("Batch calculation results:") for i in range(len(names)): print(f"{names[i]}: {velocities[i]:.2f} m/s") What's Next? Now that you have a working calculator with NumPy, you can expand…