Results for “sorted”

Showing 1–10 of 17

  1. Challenge

    Sorted copy

    Print the roster A–Z for a report with sorted() while the sign-up order stays exactly as it was, then sort names like de Vries and van Dijk correctly with key=str.lower.

    Write the code Easy 2 stages lists sorted sort key
  2. Challenge

    Launch schedule digest

    …datetime, works for the comparison and as the key for sorted() . strftime("%Y-%m-%d %H:%M") formats a datetime. Time left, and holds Add the time left to each launch, as days, hours and minutes, and…

    Write the code Medium 3 stages project json datetime timedelta
  3. Challenge

    Sort by a field

    Sort launches by date with sorted() and a small function that returns each launch's date, then sort the cargo manifest heaviest first with a key function and reverse=True.

    Write the code Easy 2 stages functions sorted key reverse
  4. Challenge

    Manifest diff

    …added since yesterday and which were removed, each list sorted: Added: CG-0047, CG-0048 Removed: CG-0043, CG-0045 set(today) - set(yesterday) is what today has that yesterday didn't. A set has no…

    Write the code Easy 2 stages sets difference intersection sorted
  5. Challenge

    Mass by category

    …49.8 kg (41%) crew: 3.4 kg (3%) spares: 2.4 kg (2%) sorted(totals, key=totals.get, reverse=True) gives the categories ordered by their totals. sum(totals.values()) is the whole load.

    Write the code Medium 2 stages dictionaries grouping get sorted
  6. Challenge

    sort() returns None

    …before you check. Modify. Fix the sort so the roster is sorted and kept. It must print: Roster: ['Kowalska', 'Lindqvist', 'Okafor', 'Tanaka'] Make: Top three readings Sort the engine readings from…

    Fix the code Easy 3 stages lists sort None in place
  7. Challenge

    Ground pass planner

    …every contact window longer than 8 minutes into one list, sorted by time, then find the longest stretch with no station in contact, counting overlapping passes only once.

    Write the code Medium 2 stages project datetime timedelta sorting
  8. Challenge

    Counter

    …2 ERROR: 1 INFO: 4 WARN: 3 Most common first Replace the sorted listing with one from the most common level down, using counts.most_common() , under a heading: By frequency: INFO: 4 WARN: 3 DEBUG: 2…

    Fix the code Easy 2 stages collections Counter most_common dictionaries
  9. Challenge

    Airlock permissions

    …permission in needed . If not, print what is missing, sorted: Kowalska can't depressurise the airlock: missing eva_certified needed <= granted is True when every item of needed is in granted . needed…

    Write the code Medium 2 stages sets subset difference permissions