Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import turtle
- window = turtle.Screen()
- t = turtle.Turtle()
- a = int(input())
- r = int(input())
- # круг
- t.penup()
- t.forward(r)
- t.left(90)
- t.pendown()
- t.circle(r)
- t.penup()
- t.right(90)
- t.goto(-a / 2, a / 2)
- # квадрат
- t.pendown()
- t.forward(a)
- t.right(90)
- t.forward(a)
- t.right(90)
- t.forward(a)
- t.right(90)
- t.forward(a)
- # крыша
- t.right(30)
- t.forward(a)
- t.right(120)
- t.forward(a)
- print("Я построил квадрат со стороной:", a, ", круг с радиусом:", r, "и треугольник со стороной:", a)
- turtle.done()
Advertisement
Add Comment
Please, Sign In to add comment