Results for “for”

Showing 191–200 of 202

  1. 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
  2. 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
  3. 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
  4. 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
  5. Challenge

    Sensor ID parts

    …the unit next to it. Take the ID apart, then make it work for subsystems whose names contain a dash themselves. Subsystem and number Split the ID at the dash. Print the subsystem, the unit number as…

    Write the code Medium 2 stages strings split rsplit int
  6. Challenge

    Unit mix-up

    The flight dynamics team is checking the plan for a transfer to the Moon. One leg comes from a contractor's planning tool, and the total doesn't look right. Predict what the code prints, find the leg…

    Fix the code Easy 3 stages units conversion constants debugging
  7. Challenge

    Running totals

    …one variable up to date instead of creating a new one for each step. Predict how -= and += change a value, follow the fuel through a whole sequence, then track a battery yourself. Predict and run…

    Write the code Easy 3 stages variables -= += updating values
  8. Challenge

    Names that explain

    Somebody wrote a quick calculation for the cargo module and called the variables a , b , x2 and tmp . The program works, but nobody, including its author a month from now, can tell what it calculates…

    Fix the code Easy 3 stages variable names refactoring readability clean code