Results for “new line”

Showing 11–20 of 44

  1. Challenge

    Read the traceback

    …from the bottom up to find the error, the function and the line, fix the bug there, then follow a longer traceback through four calls to a second bug.

    Fix the code Easy 2 stages errors traceback KeyError TypeError
  2. 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
  3. Article Python Fundamentals

    Python print() Function

    …quotes (""") Perfect for longer messages with multiple lines: message = """ Space Station Report: Temperature is stable Oxygen levels normal All crew members safe """ print(message) Using backslash to…

  4. Challenge

    Crew roster

    Print 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
  5. Challenge

    Log to a file

    …log entries to mission.log with with open(), 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
  6. Challenge

    Ground station pick

    Choose New Norcia, Cebreros or Malargüe from the longitude under a spacecraft with an if/elif chain of ranges, then accept longitudes from 0 to 360 and reject values that can't be longitudes.

    Write the code Easy 2 stages if elif else ranges