CS2 Computational Thinking for Scientists - Lab 05In this lab, we will experiment with recursive Python programs for drawing fractals. I have created a Python module fractals.py. Download this module into a folder in your desktop. Run the following commands in order to import the functions in fractals.py in to your IDLE platform:
import os os.chdir("/Users/koc/Desktop/abc") from fractals import *Change the file path from above to the one you will be using.
Also, import the turtle and the math modules:
import turtle, mathsince we will be using them as well.
The following recursive functions are available in fractals.py module:
tony = turtle.Turtle() # create a turtle tony.up() # pen up tony.goto(-100,-100) # left bottom corner tony.down() # pen down koch1(tony,4,200) # order = 4 and length = 200
Report: This lab requires a report. Experiment with these functions, and create several different triangles, squares, or other polygons whose sides are Koch or Torn or other types of fractals. Finally, submit your "best looking fractal", by emailing your Python program and an image (screen shot) file of the fractal.
The lab report (if required) is due 5pm, Friday Feb 13.