for循环遍历

课程:Python · 编程练习

Python编程练习 - for循环遍历

练习内容

# 使用for循环遍历列表\nfruits = ["苹果", "香蕉", "橙子", "葡萄"]\n\nfor fruit in fruits:\n print(f"我喜欢吃{fruit}")\n\n# 使用range生成数字序列\nfor i in range(1, 6):\n print(f"第{i}次循环")\n\n