Results for “and”

Showing 121–130 of 150

  1. Challenge

    Tank level

    Turn a tank's capacity and contents into a fill percentage with one decimal place, then draw the crew display's ten-segment gauge with string repetition and int().

    Write the code Easy 2 stages percentage division rounding string repetition
  2. Challenge

    Test the parser

    …a good line first, then None for a blank line, a comment and a line with a missing field, so a broken parser can't pass.

    Write the code Medium 2 stages testing assert parsing None
  3. Challenge

    Approved payloads

    …than parts of text, then normalise IDs typed by hand and print a clear cleared or not-cleared message.

    Write the code Easy 2 stages lists in membership if
  4. Challenge

    Roster changes

    …1, remove() someone who left, then pop() the newest member and print who was reassigned.

    Write the code Easy 2 stages lists append insert remove
  5. Challenge

    Alert level

    …engine temperature into OK, WARN or CRITICAL with if, elif and else and two thresholds, check the exact boundaries, then store the level in a variable for a status line.

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

    Counter

    …level counter from "Entries per level": replace the dict and counts.get() with collections.Counter, which starts every key at 0, then list the levels from most to least common with most_common().

    Fix the code Easy 2 stages collections Counter most_common dictionaries
  7. Challenge

    Lookup table

    Replace a nine-branch elif that maps planets and the Moon to surface gravity with a dict and one get() lookup, keeping the output exactly the same, then loop over the dict for a weight table.

    Fix the code Medium 2 stages dictionaries refactoring lookup tables get
  8. Challenge

    Shift rota

    The station runs around the clock: a morning, an afternoon and a night shift, every day of the week. Making the rota by hand takes the commander an hour every Sunday, and twice this month somebody…

    Write the code Hard 2 stages project scheduling lists tuples