有大神可以用python的turtle模块画图吗,求解

有大神可以用python的turtle模块画图吗,求解求代码,三个随便一个。万分感谢

第1个回答  2019-06-24
from turtle import*
pensize(4)
penup()
fd(150)
right(90)
fd(200)
pendown()
seth(100)
fd(150)
seth(31)
circle(130,300)
seth(170)
fd(80)#shou
seth(85)
fd(30)#qiang
left(90)#qiang
fd(120)#qiang
left(90)#qiang
fd(40)#qiang
left(90)#qiang
fd(80)#qiang
right(90)
fd(45)
left(90)
fd(40)
left(90)
fd(21)
penup()
fd(30)
pendown()
seth(100)
circle(20,290)
seth(340)
fd(90)
seth(270)
fd(100)
penup()
seth(90)
fd(250)
pendown()
pensize(20)
seth(270)
fd(7)
penup()
seth(0)
fd(100)
pendown()
seth(90)
fd(7)
penup()
第2个回答  2018-06-15
因为你的目录有一个叫turtle.py的文件,引入的时候并不是引入的系统的turtle模块,而是引入你的自己的这个文件,所以文件起名的时候注意不要和系统模块重名。本回答被网友采纳
第3个回答  2020-07-04
如果你想画正方形可以:
import turtle
for i in range(4):
turtle.forward(100)
turtle.right(90)
或者:
import turtle
turtle.forward(100)

turtle.right(90)
turtle.forward(100)
turtle.right(90)
turtle.forward(100)
turtle.right(90)
turtle.forward(100)本回答被网友采纳
相似回答