Commit 12a16a84 by BellCodeEditor

auto save

parent 76efe980
Showing with 46 additions and 0 deletions
while True:
import turtle
print("欢迎来到画图系统")
n=input("请输入1:画圆系统,2:画正多边形系统,3:画五角形系统......")
if n=="q":
break
if n=="1":
print("画圆系统")
b=input("请输入圆的半径")
t=turtle.Turtle()
t.circle(int(b))
turtle.done()
if n=="q":
break
if n=="2":
print("画正多边形系统")
b=int(input("请输入边数"))
c=int(input("请输入边长"))
t=turtle.Turtle()
for i in range(b):
t.fd(c)
t.left(180-(b-2)*180/b)
turtle.done()
if n=="q":
break
if n=="3":
print("画五角形系统")
b=int(input("请输入角数"))
c=int(input("请输入边长"))
t=turtle.Turtle()
t.pencolor("red")
t.fillcolor("yellow")
t.begin_fill()
if b%2==0:
for i in range(b):
t.fd(c)
t.left(180*(b-2)/b)
else:
for i in range(b):
t.fd(c)
t.left(180*(b-1)/b)
t.end_fill()
turtle.done()
if n=="q":
break
\ No newline at end of file
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 sign in to comment