Results for “append”

Showing 1–10 of 33

  1. Challenge

    Filter the log

    …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
  2. Challenge

    Roster changes

    Apply a day's crew changes to a list: append() a new member, insert() a backup at position 1, remove() someone who left, then pop() the newest member and print who was reassigned.

    Write the code Easy 2 stages lists append insert remove
  3. Challenge

    Log to a file

    …one per line, read the file back and print it, then add an append_entry() function that adds lines at the end without wiping what is there.

    Write the code Easy 2 stages files open with write
  4. Challenge

    Undo and history

    Extend the working cargo 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
  5. Challenge

    Last five readings

    …reading has arrived. Add new_reading = 772 under the list, append it to the readings, then show the new window and how much the level changed between its first and last reading, with a sign…

    Write the code Easy 2 stages lists slicing negative slice append
  6. Challenge

    Changed the caller's list

    add_reading() appends to the list it receives, so the caller's stored readings change too. Predict the first line, prove both names share one list, fix it by returning a new list, then write a filter…

    Fix the code Medium 3 stages functions lists mutation return
  7. Article Mini projects

    Medical dispenser - Don’t trust the user

    …limit reached" # Dispense the medication self.dose_history.append(current_time) return "DISPENSED: One dose of space aspirin delivered" # Grace's hack in action: dispenser = NaiveMedicationDispenser()…

  8. Challenge

    Parser function

    …dict. The loop still skips blank and comment lines, then appends parse_line(line) . None for lines that aren't readings Move the skipping into the function as well. parse_line() strips the line, so…

    Fix the code Medium 2 stages functions return dictionaries None