Python Quest

Track 10 · Lesson 2 of 12

math, random and statistics

Calculate with the math module, generate reproducible random values with seeds, and summarise data with statistics.

About 40 minBeginner4 exercises

You will be able to

  • Use math functions such as sqrt, hypot, floor, ceil, isclose, prod and comb
  • Generate random numbers, choices and samples, and make them reproducible with a seed
  • Use a separate random.Random(seed) generator so one part of a program cannot disturb another
  • Summarise numbers with statistics.mean, median, mode, stdev and pstdev, and handle data that is too small

Included with a Formula Quest membership

It has 4 graded exercises with feedback, hints and solutions. Python Quest is included in Formula Quest memberships that cover Python; membership and billing are managed on Formula Quest.

View Formula Quest memberships

Tracks 1 and 2, the first lesson of every track, the playground and the dataset library are free.