Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from turtle import Turtle
- T1 = Turtle()
- def circleArea(radius):
- return 3.14 * radius * radius
- def circleCircumference(radius):
- return 3.14 * radius * 2
- def drawCircle (tName, radius, col):
- tName.color(col)
- tName.dot(2 * radius)
- tName.penup()
- tName.goto(0,10) # Move turtle to x = 0, y = 10
- tName.pendown()
- tName.color ("black")
- tName.write("Area: " + str(circleArea(radius)), align = "center", font=("Arial", 24, "normal"))
- tName.penup()
- tName.goto(0,-20) # Move turtle to x = 0, y = -20
- tName.pendown()
- tName.write("Circ: " + str(circleCircumference(radius)), align = "center", font=("Arial", 24, "normal"))
- tName.hideturtle()
- drawCircle (T1, 150, "yellow")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement