Results for “count”

Showing 11–20 of 76

  1. Challenge

    Summary function

    Write summarise(readings), which returns the count, min, max and mean of a list of readings as one dict, then make it handle a pass with no data and round the mean, so any program can use the summary.

    Write the code Medium 2 stages functions return dictionaries min
  2. 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
  3. 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
  4. 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
  5. Article Mini projects

    Base 6 Number System in Python

    In Project Hail Mary, the alien engineer Rocky counts in base 6 because he has two hands with three fingers each. In this article, you'll build Python programs that convert between decimal, base-6…