diff --git a/circle_area.py b/circle_area.py index 513d6f7..7a93baf 100644 --- a/circle_area.py +++ b/circle_area.py @@ -1,6 +1,12 @@ # circle_area.py # -------------- # By MWC Contributors +import math #imports pi constant +##Refactor with a function## print("This program will calculate the area of a circle.") radius = float(input("What is the circle's radius? ")) +def circleArea(radius): + return math.pi * (radius ** 2) + +print(circleArea(radius)) \ No newline at end of file diff --git a/greetings.py b/greetings.py index 2d878a6..141e773 100644 --- a/greetings.py +++ b/greetings.py @@ -1,7 +1,7 @@ # greetings.py # ------------ -# By MWC contributors +# By Louis Cooper -my_name ="Chris" +my_name = input("What is your name? ") greeting = "Hello, " + my_name print(greeting) diff --git a/shapes.py b/shapes.py index 731ec39..bab03ce 100644 --- a/shapes.py +++ b/shapes.py @@ -1,11 +1,23 @@ # shapes.py # --------- -# By MWC contributors +# By Louis Cooper from turtle import * def triangle(side_length): - pass + for i in range(3): + forward(side_length) + right(120) + + + def rectangle(height, width): - pass + for i in range(2): + forward(width) + right(90) + forward(height) + right(90) + +#rectangle(200, 100) +#triangle(100) \ No newline at end of file