Results for “for”

Showing 121–130 of 136

  1. Challenge

    Launch commit criteria

    …on its own doesn't tell the launch director what to wait for. Before the decision, print one line for every rule that fails: Wind 34 km/h, limit 30 km/h Lightning in the area Launch: HOLD Give each…

    Write the code Easy 2 stages if else and not
  2. Challenge

    Normalise a command

    …abort burn: True replace("_", " ") swaps every underscore for a space. Add it, and one for dashes, to the end of the chain.

    Write the code Easy 3 stages strings strip lower replace
  3. Challenge

    Readings that won't add

    …computer as text, the way most data arrives from files, forms and networks. The code that adds them up looks right, but the total it prints makes no sense. Predict what it prints, find out why, fix…

    Fix the code Easy 3 stages type conversion int float str
  4. Challenge

    Mission elapsed time

    …76.3 The middle line is how Python prints a timedelta . For the hours, divide elapsed.total_seconds() by 3600. Three time zones Ground stations report events in their own clock's time zone: UTC…

    Write the code Medium 2 stages datetime timedelta ISO 8601 time zones
  5. Challenge

    Test the error

    …Leave the function as it is. The hidden tests swap it for a version that doesn't raise at all, and one that raises TypeError instead; your check must fail on both. The message, and what must still…

    Write the code Medium 2 stages testing assert try except
  6. Challenge

    Readings summary

    …an empty list would crash min() and the division. For an empty list, print only No readings . Min: 398.0 Max: 455.2 Mean: 419.5 Spread: 57.2 Check len(readings) == 0 first, and move the summary under…

    Write the code Easy 2 stages lists min max sum
  7. Challenge

    Roster changes

    …someone new joins, a backup steps in, someone leaves for another mission. The roster has to follow every change, in the right order, because position 1 is the deputy commander's place. Apply today's…

    Write the code Easy 2 stages lists append insert remove
  8. Challenge

    Redact the access code

    …operator=2 line.find(" ", start) searches for a space starting at index start , so it finds the space after the code, not the first one in the line. Then line.replace(code, masked) builds the new…

    Write the code Medium 2 stages strings slicing len replace
  9. Challenge

    Search the log

    …slice from where ERROR starts, plus its length, plus one for the space, and leave the end out. The time in brackets can grow longer, [T+100:02:00] , so work from position , not from a fixed number.

    Write the code Medium 2 stages strings in find slicing