Results for “for”

Showing 111–120 of 136

  1. Challenge

    Index by ID

    The crew ask for cargo by ID all day long: "where is CG-0045, and how heavy is it?". Searching the whole manifest list for every question works for six items, but the real manifest has thousands…

    Write the code Medium 2 stages dictionaries indexing lookup in
  2. Challenge

    Approved payloads

    …Check an ID against the list, then make the check work for IDs typed by hand. On the list? Print whether the payload is on the approved list: PL-204 approved: True payload_id in approved gives True or…

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

    Upload router

    ….png or .jpg images .csv telemetry anything else rejected For the camera image in the starter code: cam-1_2026-03-14.png -> images/ Use endswith() for each extension, or to accept two, and store the…

    Write the code Easy 2 stages if elif else or
  4. Challenge

    Accept the right files

    …a photo and a backup file, and the archive's import broke for a day. Check every path before it's accepted, then make the checks work for paths typed on a Windows PC. Check the ends Print whether the…

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

    Guard clauses

    …condition at a time, each inside the last, and the reason for a refusal now sits four levels deep, at the far end of an else whose if is off the top of the screen. Flatten the function without…

    Fix the code Medium 2 stages functions return guard clauses refactoring
  6. Challenge

    Signal delay

    …distance even light takes minutes. Work out the delay for today's distance: first in seconds, then as minutes and seconds, then for the round trip. Python lets you write big numbers with underscores…

    Write the code Medium 3 stages division round // %
  7. Challenge

    Tank level

    …display draws each tank as a gauge of 10 segments: one # for every full 10% and a - for the rest. Tank B: [#######---] 73.4% Work out how many full tens the percentage has, then repeat "#" that many…

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

    API response

    …launch["name"] . Inside an f-string, use single quotes for the key: {launch['name']} . Everything in the response Before relying on an API, developers look at a whole response. After the three lines…

    Write the code Easy 2 stages dictionaries keys items JSON
  9. Challenge

    Flatten nested ifs

    The docking check for the station works, but it has grown into three if statements inside each other, with HOLD written out three times. Every new rule would push the code further to the right…

    Fix the code Medium 2 stages if elif and nested conditions