📜  对于在 python 代码示例中

📅  最后修改于: 2022-03-11 14:45:29.090000             🧑  作者: Mango

代码示例6
# how to use for in python for (range, lists)
fruits = ["pineapple","apple", "banana", "cherry"]
for x in fruits:
  if x == "apple":
    continue
  if x == "banana":
    break
  print(x)
# fron 2 to 30 by 3 step
for x in range(2, 30, 3):
  print(x)