Challenge
Fuel for a burn
Ask for an engine burn length with input(), turn it into a number with float() and work out the propellant it uses, then read the tank level too and show what the burn leaves.
Showing 1–10 of 136
Challenge
Ask for an engine burn length with input(), turn it into a number with float() and work out the propellant it uses, then read the tank level too and show what the burn leaves.
Challenge
…prints 12 , but {seconds} prints 5 , not 05 . Add a format spec after a colon: {seconds:02} means "at least 2 characters wide, filled with zeros".
Challenge
Move the mission log's f-string into format_log(t, level, msg), a function that returns the line instead of printing it, then fix the alignment of every log line with one change inside the function.
Challenge
…is ten orbits long, and the flight log should have a line for each one. The log always ends one orbit early, and the last orbit, the one that matters for the landing, is never in it. Predict the last…
Challenge
…line.split()[1] . LEVELS.index(level) gives its rank, 0 for INFO up to 2 for ERROR, so compare the ranks.
Challenge
Scan the mission log for the first ERROR entry, print its line number with enumerate() and stop there with break, then report how many lines were checked, or that there were no errors at all.
Challenge
Print one cargo manifest line for every record in a list of dicts, reading each field by key, then add up the masses in the same loop for a total line.
Challenge
Extend the OK/WARN/CRITICAL check from Alert level so a for loop runs it over every temperature in a list, then count the WARN and CRITICAL readings for a summary line.
Challenge
Turn the day's subsystem status into a fixed-width report for the shift handover, with aligned columns and a totals line, then save the same data as a CSV file with csv.DictWriter for the spreadsheet…
Challenge
…that every programmer meets once, then round it for display the way fuel gauges and dashboards do.