generated from mwc/lab_iteration
	Checkpoint 3: Yes I do think I will use docstrings as it will help me provide space to write explain the meaning of the code along with what it is doing. They can be very useful.
		
			
				
	
	
		
			32 lines
		
	
	
		
			594 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			594 B
		
	
	
	
		
			Python
		
	
	
	
	
	
from turtle import *
 | 
						|
 | 
						|
def draw_tile(size):
 | 
						|
    "Draws one tile, which can be repeated to form a pattern."
 | 
						|
    draw_tile_outline(size)
 | 
						|
    draw_stripe(size)
 | 
						|
 | 
						|
def draw_tile_outline(size):
 | 
						|
    pencolor("#dddddd")
 | 
						|
    square(size)
 | 
						|
 | 
						|
def draw_stripe(size):
 | 
						|
    pencolor("black")
 | 
						|
    fly(size/4)
 | 
						|
    left(90)
 | 
						|
    forward(size)
 | 
						|
    backward(size)
 | 
						|
    right(90)
 | 
						|
    fly(-size/4)
 | 
						|
 | 
						|
def fly(distance):
 | 
						|
    "Moves without drawing."
 | 
						|
    penup()
 | 
						|
    forward(distance)
 | 
						|
    pendown()
 | 
						|
 | 
						|
def square(size):
 | 
						|
    "Draws a square of side length `size`"
 | 
						|
    for side in range(4):
 | 
						|
        forward(size)
 | 
						|
        left(90)
 |