Results for “print”

Showing 41–50 of 150

  1. Challenge

    Numbered checklist

    Print a pre-flight checklist numbered from 1 with enumerate(list, start=1), then tick off the items the crew has already done with [x] and leave the rest as [ ].

    Write the code Easy 2 stages for loop enumerate start lists
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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