用户:
SGY鸾不爱吃烤小鸟查看:6 回复:3 评论:6 创建时间:2021-02-08T15:48:56
【作品展示】

【作品介绍】
注释为题目,该怎么填充代码呢?(嘤嘤嘤)
【作品源代码】
# 现在要实现能够3次输入颜色对应的单词,能够打印出对应的颜色和形状
# 例1:
# 输入:red
# green
# yellow
#输出:红色
#红色五边形
#绿色
#绿色圆形
#黄色
#黄色梯形
#该怎么填充模板呢?(疑惑(・∀・(・∀・(・∀・*)······)(注:是连续输入哦)
color = ['黄色', '绿色', '蓝色', '红色']
shape = ['红色五边形', '蓝色三角形', '绿色圆形', '黄色梯形']
for i in range(len()):
a = input()
if (a == 'red'):
print(color[])
print(shape[])
elif (a == 'blue'):
print(color[2])
print(shape[1])
elif (a == 'green'):
print(color[1])
print(shape[2])
else:
print(color[])
print(shape[])
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cnimport turtle
t = turtle.Pen()
#设置填充颜色
t.fillcolor('red')
#设置填充起点
t.begin_fill()
#设置填充终点并填充
t.end_fill()点赞0
评论