Results for “python version”

Showing 1–10 of 11

  1. Challenge

    Environment check

    Every useful bug report starts with the Python version. Ask Python for it with the platform and sys modules and print it the way python --version does.

    Write the code Easy 3 stages platform sys python version bug report
  2. Challenge

    Test the error

    …passes only when fuel_needed(-5) raises ValueError, so a version that returns a value or raises the wrong error fails it, then pin down the message and the lengths that must still work.

    Write the code Medium 2 stages testing assert try except
  3. Challenge

    Wrong line commented out

    A real check is commented out and a debug line is left on. Use # comments to put the pre-flight checklist script back in order. A beginner Python challenge on comments.

    Fix the code Easy 2 stages comments debugging print
  4. Challenge

    Sorted copy

    …sorted(signups, key=str.lower) compares the lower-case version of each name but keeps the names as they are.

    Write the code Easy 2 stages lists sorted sort key
  5. Challenge

    Validate a command

    …Keep the typed text in one variable and the lower-case version in another. Check for empty text first. For Launch , the second line is printed.

    Write the code Easy 2 stages if elif else input
  6. Challenge

    Prove the fix

    …function as it is. The hidden tests swap it for the old version with log=[] , and your checks must stop that one. Don't break what worked A fix can go too far. Add checks that a log passed in still…

    Write the code Medium 2 stages testing assert regression tests default values
  7. Challenge

    Flatten nested ifs

    …not change: Docking: GO Whatever the readings are, your version has to print exactly what the nested one would. Say what failed The crew wants to know why docking is on hold. Rewrite the check as one…

    Fix the code Medium 2 stages if elif and nested conditions
  8. Challenge

    Accept the right files

    …the right file. Clean the path first, then check the clean version: In telemetry/: True CSV file: True Remove the spaces, turn backslashes into forward slashes and make it lower case. Inside quotes, a…

    Write the code Easy 2 stages strings startswith endswith paths
  9. Challenge

    Redact the access code

    …ground station goes into the security log, and the first version of the logger wrote the full access code into it. Anyone who could read the log could log in. Mask the code so only its last four…

    Write the code Medium 2 stages strings slicing len replace