import turtle number = int(input()) turtle.screensize(600,500,‘white‘) turtle.pensize(3) turtle.pencolor(‘blue‘) turtle.fillcolor(‘yellow‘) turtle.begin_fill() turtle.forward(-300) if num>=3 and num<10: for i in range(3,number): turtle.circle(50, steps=i) turtle.forward(100) turtle.circle(50) turtle.end_fill() turtle.hideturtle() turtle.done()
原文:https://www.cnblogs.com/l-jy/p/13752870.html