Results for “insert”

Showing 1–10 of 16

  1. Challenge

    Roster changes

    …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
  2. Article Mini projects

    Managing Astronaut Medical Data with Python

    …cursor = conn.cursor() cursor.execute("INSERT INTO astronauts (name, age, nationality) VALUES (?, ?, ?)", (name, age, nationality)) conn.commit() conn.close() # Clear the entry fields…

  3. Challenge

    Log to a file

    …each line without its line break: [T+00:10:00] INFO Orbit insertion complete [T+00:12:05] WARN Battery 3 temperature high [T+00:14:47] ERROR Fuel valve 2 not responding The hidden tests also open…

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

    Mission elapsed time

    …since launch, after the three lines from before: Orbit insertion: T+0:11:12 Solar array deployed: T+0:32:00 First image: T+3 days, 4:15:30 Parse each timestamp as it is, offset included, and subtract…

    Write the code Medium 2 stages datetime timedelta ISO 8601 time zones
  5. Challenge

    Log analyser

    Turn the launch-day mission log into answers: parse each line into a dict, count the entries per level and per hour, find the first ERROR, then rank the subsystems by how many warnings they raised.

    Write the code Hard 3 stages project logs parsing Counter
  6. Challenge

    Count warnings

    Count the entries and the WARN lines in a multi-line mission log with count(), fix the count when a message mentions WARN itself, then summarise the log by level.

    Write the code Medium 3 stages strings count multi-line strings logs