[python]代码库
import turtle as t
num = int(input("请输入(阿拉伯数字3-10):"))
t.pu()
t.goto(-200,-200)
t.pd()
if num == 3:
for i in range(3):
t.fd(300)
t.left(120)
elif num == 4:
for i in range(4):
t.fd(300)
t.left(90)
elif num == 5:
for i in range(5):
t.fd(300)
t.left(72)
elif num == 6:
for i in range(6):
t.fd(150)
t.left(60)
elif num == 7:
for i in range(7):
t.fd(150)
t.left(51.429)
elif num == 8:
for i in range(8):
t.fd(150)
t.left(45)
elif num == 9:
for i in range(9):
t.fd(150)
t.left(40)
elif num == 10:
for i in range(10):
t.fd(120)
t.left(36)
else:
print("暂时没有")
[代码运行效果截图]
[源代码打包下载]