Results for “break”

Showing 21–30 of 33

  1. Article Python Fundamentals

    Python print() Function

    …telescope_temp_timestamp) Special characters and line breaks When logging space mission data, you often need to organize information across multiple lines. The newline character "\n" is like pressing…

  2. Challenge

    Edge cases

    …ordinary cases, then for the edges, where real programs break. Ordinary lists Below the function, write assert checks for an ordinary list of readings and for a list with only one value. Include a…

    Write the code Medium 2 stages testing assert edge cases None
  3. Challenge

    Test the alert levels

    …. Leave the function exactly as it is: the hidden tests break copies of it and expect your checks to notice. On the thresholds Bugs hide at the boundaries. Add checks for the values exactly on each…

    Write the code Medium 2 stages testing assert functions boundaries
  4. Article Python Fundamentals

    Online Python Editor

    …Most look like they were designed in 2005, crash when you breathe wrong, and forget about running anything more complex than print("Hello World"). Mobile experience? Even worse. Tiny buttons you can't…

  5. Challenge

    Log to a file

    …read it line by line and print each line without its line break: [T+00:10:00] INFO Orbit insertion complete [T+00:12:05] WARN Battery 3 temperature high [T+00:14:47] ERROR Fuel valve 2 not responding…

    Write the code Easy 2 stages files open with write
  6. Challenge

    Test the error

    …the arithmetic is, and like the arithmetic it can quietly break. Write the test that keeps it honest. The hidden tests run your checks against broken versions of the function to see whether they…

    Write the code Medium 2 stages testing assert try except
  7. Article Python Fundamentals

    Python If/Else for Beginners

    …bites everyone at least once. Overly complex conditions: Break them into named boolean variables for clarity. safe_fuel = fuel >= 60 good_weather = wind_speed < 20 if safe_fuel and good_weather…

  8. Article Python Fundamentals

    Nested Loops in Python

    …if x == scan_x and y == scan_y: rover_found = name break if rover_found: print("🔴", end=" ") # Rover! else: print("⚫", end=" ") # Empty surface print() # New line after each row # List of found rovers…

  9. Article Mini projects

    Medical dispenser - Don’t trust the user

    …painkillers. Ask yourself: "Could a desperate astronaut break this?" If the answer is yes, it's time to implement proper security measures. And let's face it - if Grace had physical access to the…

  10. Article Python Fundamentals

    Variables and data types in Python

    …while and elif global not with as else if or yield break except import pass Example of valid variable names in space context: orbital_velocity = 7.8 # kilometers per second ISS_altitude = 408 #…