generated from mwc/lab_iteration
	figuring out how to rewrite the code was difficult
I mostly used trial and error as well as help to figure out what to write
This commit is contained in:
		
							
								
								
									
										18
									
								
								square.py
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								square.py
									
									
									
									
									
								
							@@ -1,17 +1,13 @@
 | 
			
		||||
from turtle import *
 | 
			
		||||
 | 
			
		||||
def square(side_length):
 | 
			
		||||
    forward(side_length)
 | 
			
		||||
    right(90)
 | 
			
		||||
    forward(side_length)
 | 
			
		||||
    right(90)
 | 
			
		||||
    forward(side_length)
 | 
			
		||||
    right(90)
 | 
			
		||||
    forward(side_length)
 | 
			
		||||
    right(90)
 | 
			
		||||
    for i in range(4):
 | 
			
		||||
        forward(side_length)
 | 
			
		||||
        right(90)
 | 
			
		||||
 | 
			
		||||
sizes = [20, 40, 60, 80, 100]
 | 
			
		||||
for size in sizes:
 | 
			
		||||
    square(size)
 | 
			
		||||
input()
 | 
			
		||||
 | 
			
		||||
   square(20)
 | 
			
		||||
   penup()
 | 
			
		||||
   forward(40)
 | 
			
		||||
   pendown()
 | 
			
		||||
		Reference in New Issue
	
	Block a user