generated from mwc/lab_names
	Checkpoint 2: -A function is like a variable in that it allows you to save code that will be ran everytime you call it. -Functions can break down big problems by allowing you to run the same thing over and over by just calling it. An example would be coding a house. This chould be accomplished by making a door function, triangle function, and rectangle function which could be used for the walls and smaller rectangles that could be used for the windows.
		
			
				
	
	
		
			25 lines
		
	
	
		
			382 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			382 B
		
	
	
	
		
			Python
		
	
	
	
	
	
# shapes.py
 | 
						|
# ---------
 | 
						|
# By MWC contributors
 | 
						|
 | 
						|
from turtle import *
 | 
						|
 | 
						|
def triangle(side_length):
 | 
						|
    forward(side_length)
 | 
						|
    right(120)
 | 
						|
    forward(side_length)
 | 
						|
    right(120)
 | 
						|
    forward(side_length)
 | 
						|
    right(120)
 | 
						|
 | 
						|
 | 
						|
def rectangle(height, width):
 | 
						|
    forward(width)
 | 
						|
    right(90)
 | 
						|
    forward(height)
 | 
						|
    right(90)
 | 
						|
    forward(width)
 | 
						|
    right(90)
 | 
						|
    forward(height)
 | 
						|
    right(90)
 |