Lab 3

Get the Picture

In this lab you will be learning how to extend the capabilities of Python by using modules. You’ll be using these modules to approximate the value of Pi and draw fancy pictures.

Goals

  • Practice importing and using Python modules
  • Practice using loops to generate images
  • Become familiar with the methods from the math and random modules

Permitted Functions

Below is a list of the functions you are allowed to use in this lab. Generally, the rule is if you can use it in a previous lab, you can use it in this lab. If there is something you want to use but it isn’t listed here, first check if it is on your class slides / runestone and if it’s not there ask your professor.

  • math.sqrt()
  • math.floor()
  • math.ceil()
  • math.pi
  • random.randrange()
  • random.random()
  • random.randint()
  • if / elif / else

Instructions describing what commands are available for drawing shapes can be found here.