PyAI Learn Türkçe

Module 9

Modules

import, math, random, your own file

When you finish this module you can say:

I can split my code into modules and make randomness reproducible.

By the end of this module you'll be able to split your code into your own module and write a simulation that estimates a probability by experiment, giving the same result every time it runs.

Start

Lessons

5 lessons · ≈ 48 min

  1. import and namespaces8 min
  2. math: ready-made math8 min
  3. random and seed10 min
  4. Your own module10 min
  5. Project: Dice simulation12 min · project

Practice exercises

Short writing exercises, independent of the lessons: Go to the exercises

  1. A module's public names
  2. Circle info
  3. Seeded shuffling
  4. Use the ready-made module