Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import pi
- from math import sqrt
- import turtle
- radius = int(raw_input("What radius would you like the circle to be(The Bigger the better)? "))
- turtle.penup()
- turtle.color("red")
- turtle.sety(-radius)
- turtle.pendown()
- turtle.circle(radius)
- areaofcircle = (radius*radius) * pi
- sideofsquare = sqrt(areaofcircle)
- print sideofsquare
- turtle.color("blue")
- halfsquare = sideofsquare/2
- turtle.penup()
- turtle.setx(0)
- turtle.sety(-halfsquare)
- turtle.pendown()
- turtle.forward(halfsquare)
- turtle.left(90)
- for i in range(4):
- turtle.forward(sideofsquare)
- turtle.left(90)
- turtle.write("side of square is %s" %(sideofsquare))
Advertisement
Add Comment
Please, Sign In to add comment