Results for “lists”

Showing 11–20 of 92

  1. Challenge

    Crew roster

    …the commander, the newest member and the crew size from a list with [0], [-1] and len(), then add the second in command and the whole roster joined into one line.

    Write the code Easy 2 stages lists indexing negative index len
  2. Challenge

    Approved payloads

    Check whether a payload ID is on the approved list with in, which matches whole items rather than parts of text, then normalise IDs typed by hand and print a clear cleared or not-cleared message.

    Write the code Easy 2 stages lists in membership if
  3. Challenge

    Backup that isn't

    backup = crew gives one list two names, so removing someone from the backup removes them from the live roster too. Predict it, prove it with is, fix it with copy(), then plan a crew swap on a real…

    Fix the code Medium 3 stages lists copy references is
  4. Challenge

    Check every reading

    …level so a for loop runs it over every temperature in a list, then count the WARN and CRITICAL readings for a summary line.

    Write the code Easy 2 stages for loop lists if elif
  5. Challenge

    Sorted copy

    The mission report lists the crew alphabetically, but the sign-up order matters too: it decides who gets the first training slots. The same list has to be shown both ways. Make a sorted copy for the…

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

    Filter the log

    Go through the mission log and build a new list holding only the WARN and ERROR entries with append(), then let a minimum level decide what counts, the way logging tools filter by severity.

    Write the code Medium 2 stages for loop lists append filtering
  7. Challenge

    sort() returns None

    The duty roster should list the crew alphabetically. One line of code was supposed to sort it, and since that line went in, the roster says None . Predict what it prints, find out where the crew went…

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

    Undo and history

    …console: record every change to the hold in a history list and show it with a history command, then add undo, which takes the last change off the history and reverses it.

    Write the code Hard 2 stages project lists stack append
  9. Challenge

    Validate a cargo record

    Write validate_cargo(item), which returns a list of everything wrong with a cargo record: missing fields and a negative mass, then a cargo ID that doesn't match the CG- and four digits format. An…

    Write the code Medium 2 stages functions return lists validation