Results for “count”

Showing 11–20 of 48

  1. Challenge

    Seeded simulation

    …a 5% chance of a glitch, and seed random with 42 so the count is the same on every run and a test can check it exactly, then pick a kind for each glitch with random.choice().

    Write the code Easy 2 stages random random.seed random.choice simulation
  2. Challenge

    Survive bad lines

    …stops the program. Skip lines that fail to convert and count them, then let one try cover short lines too and print each error.

    Write the code Medium 2 stages errors try except ValueError
  3. Challenge

    input() returns text

    A crew count read with input() crashes when 1 is added to it. Predict the crash, find out what input() really returns, fix it with int(), then write a packing tool that reads two numbers.

    Fix the code Easy 3 stages input int TypeError type conversion
  4. Challenge

    Missing index

    …readings and shows the latest one on screen. The developer counted five readings, wrote readings[5] , and the monitor crashes every time it starts. Predict what happens, find out which indexes exist…

    Fix the code Easy 3 stages lists indexing IndexError len
  5. Challenge

    Shift rota

    …taking the crew in turn. Print one line per day, then count how many times one person works two shifts in a row: Mon Morning: Kowalska Afternoon: Tanaka Night: Okafor Tue Morning: Bondarenko…

    Write the code Hard 2 stages project scheduling lists tuples
  6. Challenge

    What arrived?

    …pressure: <class 'float'> valve_open: <class 'str'> sample_count: <class 'int'> Make: Convert a packet Everything in this packet from the navigation computer arrived as text. Convert each value to the…

    Write the code Easy 3 stages type() data types type conversion sensor data
  7. Challenge

    Manifest diff

    …to print what was added and what was removed, then count what stayed with an intersection and print none for an empty change.

    Write the code Easy 2 stages sets difference intersection sorted