python/24-6-27-1.py

33 lines
661 B
Python
Raw Normal View History

2024-07-22 16:59:27 +08:00
b=int(input())
c=int(input())
import turtle
t=turtle.Turtle()
a=turtle.Turtle()
t.speed(0)
t.goto(0,0)
a.speed(0)
a.penup()
a.goto(200,0)
a.pendown()
t.left(90)
d=0
e=0
f=0
while 1:
for i in range(b):#for循环结构,range()函数迭代器list,tuple...
t.pencolor("black")
t.forward(c)
t.left(360/b)
a.pencolor("black")
a.forward(c)
a.left(360/b)
for i in range(b):#for循环结构,range()函数迭代器list,tuple...
t.pencolor("white")
t.forward(c)
t.left(360/b)
a.pencolor("white")
a.forward(c)
a.left(360/b)
a.backward(20)
turtle.down()