cars= ["audi", "byd","bmw","toyata" ]
for i in cars:
if i=="bmw":
print(f"Yes,We have {i.upper()}")
else:
print(f"No, but we have {i.title()}")
"""
python并不要求if elif 后面必须有else代码块
"""
python从入门到实践——chapter5if语句
最新推荐文章于 2024-11-02 16:28:26 发布