diff --git a/circle_area.py b/circle_area.py index 513d6f7..07ee054 100644 --- a/circle_area.py +++ b/circle_area.py @@ -4,3 +4,6 @@ print("This program will calculate the area of a circle.") radius = float(input("What is the circle's radius? ")) +pi=3.14 +circle_area=pi*radius*radius +print(circle_area) diff --git a/draw_with_shapes.py b/draw_with_shapes.py index 38eb934..2d7754d 100644 --- a/draw_with_shapes.py +++ b/draw_with_shapes.py @@ -7,17 +7,17 @@ from shapes import triangle, rectangle def flyto(x, y): penup() - goto(x, y) + goto(x,y) pendown() -flyto(-100, 0) -triangle(40) -triangle(60) -triangle(80) +flyto(100, 0) +triangle(90) +triangle(100) +triangle(90) triangle(100) flyto(100, 0) rectangle(10, 90) -rectangle(20, 80) +rectangle(50, 80) rectangle(30, 70) rectangle(40, 60) rectangle(50, 50) diff --git a/greetings.py b/greetings.py index 2d878a6..509bf48 100644 --- a/greetings.py +++ b/greetings.py @@ -2,6 +2,6 @@ # ------------ # By MWC contributors -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..ee0d35f 100644 --- a/shapes.py +++ b/shapes.py @@ -5,7 +5,18 @@ 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) \ No newline at end of file