Results for “python set”

Showing 31–40 of 47

  1. Challenge

    Logging instead of print

    …from the text, since the format adds it. With the level set to INFO , the debug lines disappear: INFO TANK-1 ok: 78.3% WARNING TANK-2 is low: 12.4% ERROR TANK-3 is empty INFO Tank check complete Leave…

    Fix the code Medium 2 stages logging debug info warning
  2. Challenge

    Silent branch

    status_light() returns None for Scrub because that branch sets a variable but never returns it. Predict the last line, find which statuses give None, make every path return, then write a function…

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

    Assignment in a condition

    …second_error . Modify. Fix both errors. With oxygen_status set to LOW it must print: Switch to the backup oxygen supply Make: Undocking check Write the check that runs before undocking. If the hatch…

    Fix the code Easy 3 stages if else == SyntaxError
  4. Challenge

    Unreachable branch

    …Make: Four levels The radiation monitor needs four levels, set by the flight surgeon: below 30 NORMAL from 30, below 100 ELEVATED from 100, below 1000 HIGH from 1000 SHELTER Print the level for the…

    Fix the code Easy 3 stages if elif order of conditions debugging
  5. Challenge

    Unit converter

    Write convert(), which looks a unit pair up in a table of factors, works the other way round by dividing, and refuses unknown units or missing pairs with a clear ValueError, then extend the table with…

    Write the code Medium 2 stages project dictionaries tuples as keys functions
  6. Article Python Fundamentals

    A Practical Guide to Getting Started with Programming

    …and services Data Science : Analyze complex data sets AI/Machine Learning : Create intelligent systems Automation : Streamline business processes Web Development : Create dynamic websites Scientific…

  7. Challenge

    Readings that won't add

    …The readings arrive as text, so leave the two lines that set them as they are. Convert them where you add them up, with int() , so the program prints: 200 Make: Decimal readings The cabin pressure…

    Fix the code Easy 3 stages type conversion int float str
  8. Challenge

    First error

    …With no errors in the log: No errors Checked 6 of 6 lines Set checked = 0 and found = False before the loop. Inside it, add 1 to checked for every line, and set found = True just before the break .

    Write the code Easy 2 stages for loop break enumerate flags
  9. Challenge

    Alert level

    …print once at the end: ENG-2: 412.5 °C, WARN Each branch sets level , and the single print() after the chain uses it.

    Write the code Easy 2 stages if elif else comparisons