Results for “print”

Showing 51–60 of 237

  1. Challenge

    Manifest line

    …(id, item, mass_kg) tuple into three named variables and print a cargo manifest line, then fix the ValueError when the manifest adds a fourth field.

    Write the code Easy 2 stages tuples unpacking ValueError formatting
  2. 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
  3. Challenge

    Missing reading

    …from "Alert level" so a sensor that didn't answer, None, prints NO DATA instead of crashing, without treating a real 0 as missing, then do the same for an empty field in a telemetry line.

    Write the code Medium 2 stages if else None is None
  4. Challenge

    Catch what you expect

    …is hiding somewhere inside it. Predict what the program prints, find out what the except is catching, and make it catch only what it should. Predict and run Don't run the code yet. Read it and decide…

    Fix the code Medium 3 stages errors try except ValueError
  5. Challenge

    Shadowed fuel

    …where 300 kg of propellant went. Predict what the program prints, find the second fuel_kg , fix the function, then write one that can't fall into the same trap. Predict and run Don't run the code yet…

    Fix the code Medium 3 stages functions scope local variables global variables
  6. Challenge

    Changed the caller's list

    …that were never really taken. Predict what the program prints, find out how the preview reached the stored list, fix the function, then write another one that leaves its input alone. Predict and run…

    Fix the code Medium 3 stages functions lists mutation return
  7. Challenge

    Silent branch

    …was scrubbed on live television. Predict what the board prints, find out which statuses fall through, fix the function, then write one where no path is left without an answer. Predict and run Don't…

    Fix the code Easy 3 stages functions return None branches
  8. Challenge

    Line to record

    The parser from "Skip blanks and comments" prints each reading and forgets it. The rest of the ground software needs the readings themselves: the alert check, the charts, the daily report. Each one…

    Write the code Easy 2 stages dictionaries lists parsing records
  9. Challenge

    Never-ending wait

    …to get strong enough to lock on. The waiting code should print a line each second and then report the lock. Instead, the ground station screen fills with the same line, over and over, until someone…

    Fix the code Easy 3 stages while loop infinite loop counter and