Challenge
Clear error messages
…print: 500.0 Refused: burn length can't be negative: -5 s Write raise ValueError(f"burn length can't be negative: {burn_s} s") inside an if , before the calculation. A burn of 0 seconds is allowed…
Showing 71–80 of 95
Challenge
…print: 500.0 Refused: burn length can't be negative: -5 s Write raise ValueError(f"burn length can't be negative: {burn_s} s") inside an if , before the calculation. A burn of 0 seconds is allowed…
Challenge
…times, so that a dead link doesn't block everything else. Write the retry loop against a simulator that plays back the radio's replies, then space the attempts out. Up to three tries Try up to…
Challenge
…and range safety reports GO. One failed rule means HOLD. Write the GO/HOLD decision, then make it say which rules are holding the launch. GO or HOLD Clear the launch only if all three rules are met…
Challenge
…solar panels at the Sun and waits for the ground to call. Write the rule that decides when to enter safe mode, then make it report which rule fired, so the team on the ground knows where to start…
Challenge
…long a download will take and how many passes it needs. Write their calculator: read the file size and the link speed, work out the transfer time, then plan it pass by pass. Transfer time File sizes…
Challenge
…count days as well. Mission control displays often write elapsed time as days, a slash, then the clock: DDD/HH:MM:SS . Add the days, with three digits: 001/03:46:40 A day has 86400 seconds. Once the…
Challenge
…how long the burn will be and shows what it will cost. Write that tool: read the burn length from the keyboard, work out the fuel it uses, then what's left in the tank. Fuel used The main engine uses…
Challenge
…and seconds, then for the round trip. Python lets you write big numbers with underscores, like 225_000_000 , so you can read them at a glance. Delay in seconds Work out how long a radio signal takes…
Challenge
…HOLD Format specs work on any value, including text you write straight into the braces: {'SYSTEM':<12} . Use the other kind of quotes inside, so they don't end the f-string. Readings on the right The…
Challenge
…message: {"status": "GO", "note": "Don't skip pre-check"} Write each curly brace you want printed twice: {{ prints { and }} prints } .