首页热点问题发现等你来答
我要提问

为啥报错(python)

提问时间:2023-12-26 06:11 | 栏目 分享 举报已浏览【1173】次


import turtle as ttime.sleep(10)
def watermelon(t, width, height, p_color="green", f_color="red"):
t.penup()
t.goto(0 - width / 2, 0 - height / 2)
t.pendown()
t.pensize(40)
t.pencolor(p_color)
t.fillcolor(f_color)
t.begin_fill()
for i in range(2):
t.forward(width)
t.left(90)
t.forward(height)
t.left(90)
t.forward(20)
t.end_fill()
def seed(t, x, y, r, c):
t.penup()
t.goto(x, y)
t.pendown()
t.color(c)
t.begin_fill()
for i in range(2):
t.circle(r, 90)
t.left(90)
t.end_fill()
def seeds(t, r=20, c="black"):
y = 120
for i in range(1, 5):
x = -240
for j in range(1, 7):
seed(t, x, y, r, c)
x = x + 90
y = y - 90
p1 = t.Turtle
#p1.hideturtle()
p2 = t.Turtle
#p2.hideturtle()
watermelon(p1, 600, 400, "lightgreen", "pink")
seeds(p2, c="yellow")

匿名网友 2023-12-26 06:14 精选回答

程序不止一个错,用变量设置不合理首先少了importtime#没有time模块,不能用time.sleep(10)的二是,既然用了importturtleast,怎么还要用p1=t.Turtle直接用p1=t就可以了同样p2=t.Turtle也要改为p2=t(其实p1,p2都可以不用的)最后不合理的是time.sleep(10)应该是放在程序最后,而不是在头上程序结果:

站长郑重提示:以上回答来自互联网网友,仅其代表个人观点,请谨慎参阅。

初二怎样考到前十

首先我想说,你的成绩并没有想象当中那么好,你先看一下你们当地高中的录取分数线是多少,中考超过七百分比...
3071 阅读 120 点赞

找大学安徽淮北的

淮北煤炭师范大学
1990 阅读 71 点赞

2019江苏成人高考成绩查询查不到啥原因

(个人看法,仅供参考)根据有限的信息,成绩不能查询的原因:1、成绩没有出来的可能性较大;2、用户名或...
4430 阅读 47 点赞

纸质照片

可以做到。缺点是,需要翻拍,即便进行修改,也不会达到原照片的清晰度,只能是接近。回答完毕,顺祝生活健康快乐!
2002 阅读 114 点赞

高中作文不少于80词

TitanicisalovestoryaboutJackandRose.Theywerehappy&...
2273 阅读 74 点赞
最新问答
1电大中专学历是被国家承认吗? 293 阅读 · 3 点赞
2老师遇到在初中孩子范错误时,问什么都不回答怎么办? 229 阅读 · 8 点赞
3浙江音乐学院作曲与作曲技术理论招多少人? 240 阅读 · 8 点赞
4河北省考警校的话在校考察表和档案考察表从哪里下载? 297 阅读 · 15 点赞
5西安思源学院食堂怎么样?食堂饭菜好吃吗 254 阅读 · 5 点赞
6邯郸电大中专报名流程详细? 243 阅读 · 3 点赞