generated from mwc/lab_names
i made both functions make multiple triangles and
rectangles
This commit is contained in:
@@ -3,4 +3,9 @@
|
||||
# By MWC Contributors
|
||||
|
||||
print("This program will calculate the area of a circle.")
|
||||
radius = float(input("5))
|
||||
radius = float(input("What is the circle's radius? "))
|
||||
|
||||
pi= 3.141592653
|
||||
circle_area= pi*radius*radius
|
||||
|
||||
print (circle_area)
|
||||
|
||||
22
shapes.py
22
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
|
||||
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