generated from mwc/lab_names
i made both functions make multiple triangles and
rectangles
This commit is contained in:
24
shapes.py
24
shapes.py
@@ -5,7 +5,25 @@
|
||||
from turtle import *
|
||||
|
||||
def triangle(side_length):
|
||||
pass
|
||||
|
||||
forward(side_length)
|
||||
left(120)
|
||||
forward(side_length)
|
||||
left(120)
|
||||
forward(side_length)
|
||||
left(120)
|
||||
|
||||
def rectangle(height, width):
|
||||
pass
|
||||
def rectangle(height, width):
|
||||
forward(width)
|
||||
left(90)
|
||||
forward(height)
|
||||
left(90)
|
||||
forward(width)
|
||||
left(90)
|
||||
forward(height)
|
||||
left(90)
|
||||
|
||||
|
||||
|
||||
|
||||
## Write a function for each of these to draw the shapes.
|
||||
Reference in New Issue
Block a user