Challenge
Summary function
Write summarise(readings), which returns the count, min, max and mean of a list of readings as one dict, then make it handle a pass with no data and round the mean, so any program can use the summary.
Showing 1–10 of 12
Challenge
Write summarise(readings), which returns the count, min, max and mean of a list of readings as one dict, then make it handle a pass with no data and round the mean, so any program can use the summary.
Challenge
Summarise a list of engine readings with min(), max() and a mean from sum() / len(), then add the spread and make the summary cope with an empty list instead of crashing.
Article Mini projects
…= [] self.minimum_interval = timedelta(hours=3) self.max_daily_doses = 6 def request_dose(self, current_time=None): # Trust whatever time is given (or system time) if current_time is None…
Challenge
…and after: ENGINE REPORT ============= ENG-1 avg 425.6 max 431.75 OK ENG-2 avg 400.4 max 402.25 OK ENG-3 avg 440.1 max 455.0 HOT Engines running hot: 1 Run the original first and keep its output to…
Challenge
…then space the attempts out. Up to three tries Try up to MAX_ATTEMPTS times. Attempt 1 gets the first result from the list, attempt 2 the second, and so on. Print each attempt, stop at the first "ok"…
Challenge
…then a mass that is not a number, is 0 or less, or is over MAX_ITEM_KG . Then print one line per item, named by its id or, without one, by its position: CG-0042 PASS CG-0043 PASS CG-0044 FAIL: missing…
Challenge
…"JAXA", "ground_station": "Toru\u0144", "orbits": 12, "max_temp_c": 455.2, "alerts": [ "Battery 3 temperature high", "Star tracker lost lock" ], "crewed": false, "next_pass": null } Use…
Challenge
Rewrite the four nested ifs in can_dock() as guard clauses that return a reason as soon as a check fails, keeping every answer the same, then add a new docking rule as one more guard with a default…
Challenge
…into its time, level, subsystem and message with split(maxsplit=3) , so the message stays whole, and keep them as dicts in entries , with the time as "HH:MM:SS" . Then count the entries per level…
Challenge
Clear a launch only if the wind is under 30 km/h, there is no lightning and range safety reports GO, using and and not, then print every rule that is holding the launch.