用户:
今天也要加油鸭1121查看:20 回复:6 评论:20 创建时间:2021-08-17T11:39:59
为什么提示说:
TypeError: list indices must be integers, not str on line 7
列表索引必须是整数,而不是第7行的str
伴雪纷飞哎呀,错误太多了
import turtle
t=turtle.Pen()
colors=['red','yellow','blue','green']
t.pencolor(colors[0])
turtle.bgcolor(colors[2])
for i in range(100,200,1):
t.forward(i)
t.left(91)
1.第7,8行的索引要用整形
2.第五行,调用一个类,要加括号
点赞1
评论