4.2:
~~~if else语句
~~~range函数
无法正常输出
~~~len , zip
my_list = ['apple', 'banana', 'cherry']
indices = range(len(my_list))
for index, value in zip(indices, my_list):
print(f"Index: {index}, Value: {value}")
~~~enumerate
animals = ["dog", "cat", "mouse"]
for i, value in enumerate(animals):
print(i, value)
i是索引,value是值,和js不一样