Space Python Loading Python…

Flight software review

Fix the codeHard 2 stages

The pre-burn check decides whether the orbit-raising burn goes ahead. Someone changed it last night in a hurry, and now it doesn't even start. The burn window opens in an hour, and you are the reviewer.

There are five bugs. Four of them stop the program, each with an error that tells you where to look. The fifth doesn't stop anything, and it is the most dangerous one.

Run the program, read the error, fix it, and run again, until it runs to the end. Four bugs stop it: a syntax error, a type error, a missing key and an index out of range. Fix each one where the error points, without changing the readings or the limits. When it runs, it starts with:

Checked 4 sensors, last: CABIN
  ENG-2: 455.0 outside 0.0-450.0

Look at the decision line it prints after that. If it seems wrong to you, you are right: that is the fifth bug, for stage 2. This stage checks the lines above.

It runs to the end

Finish stage 1 to unlock this stage.

ENG-2 is over its limit, and the program says GO. Fix the decision, so that any problem means NO GO:

Checked 4 sensors, last: CABIN
  ENG-2: 455.0 outside 0.0-450.0
Decision: NO GO

The hidden tests also run the check with readings that are all inside their limits, which must give GO, and with two other sensors out of range.

The right decision
You're not logged in, so your progress is kept in this browser only. Log in to save it, and to use hints and solutions.

Hints

script.py
PythonLn 1, Col 1Spaces: 4
Loading the Python environment…

Separate arguments with commas. They're passed on every Run as sys.argv[1:].