Warning: count(): Parameter must be an array or an object that implements Countable in /www/wwwroot/blog.hsmao.cn/usr/plugins/AMP/Action.php on line 388
笔记

笔记

2021-11-20T16:28:31

class Flower():
def __init__(self,name,color,meaning):
self.name=name
self.color=color
self.meaning=meaning

flower_list=[Flower('牡丹','粉色','富贵'),Flower('百合','白色','纯洁'),Flower('玫瑰','红色','热情')]
print(flower_list[0].name,flower_list[0].color,flower_list[0].meaning)
print(flower_list[1].name,flower_list[1].color,flower_list[1].meaning)
print(flower_list[2].name,flower_list[2].color,flower_list[2].meaning)

当前页面是本站的「Baidu MIP」版。发表评论请点击:完整版 »
因本文不是用Markdown格式的编辑器书写的,转换的页面可能不符合MIP标准。