猫史档案馆


【Python作品分享】求助!应该怎么做?【求助帖】

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


【作品展示】

center_image

 

【作品介绍】

注释为题目,该怎么填充代码呢?(嘤嘤嘤)

 

【作品源代码】

# 现在要实现能够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.cn


回复

上一页1 页 / 共 1下一页
BZIClawLYNEYBZIClawLYNEY

你并没有画这个图形

点赞0


评论


SGY鸾不爱吃烤小鸟SGY鸾不爱吃烤小鸟

大家不用思考了!问题已经解决啦!如果你点进来了,那么蟹蟹大大想帮助我www

点赞0


评论


浮躁的飓风雀HYKa浮躁的飓风雀HYKa

import turtle
t = turtle.Pen()

#设置填充颜色
t.fillcolor('red')

#设置填充起点
t.begin_fill()

#设置填充终点并填充
t.end_fill()

点赞0


评论