Commit ba948686 by Patryk Czarnik

turtle wielokąt - v2

parent 485206dc
import turtle
import math
boki = int(turtle.numinput('Pytanie', 'Podaj liczbę boków'))
t = turtle.Turtle()
OBWOD = 1200
kat = 360 / boki
bok = OBWOD / boki
t.penup()
t.goto(-bok/2, -OBWOD/(2*math.pi))
t.pendown()
t.width(4)
t.color("blue", "#FFFFDD")
t.begin_fill()
for i in range(boki):
t.forward(bok)
t.left(kat)
t.end_fill()
turtle.mainloop()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment