数数
range(n) [0, n)
range(m,n) [m, n)
range(m,n,p) [m,n) 每隔p取一个
# 重点
for i in range(len(lst)):
i 索引
lst[i] 元素
# i = 1
# while i <=100:
# print(i)
# i += 1
# range(参数) [0,参数)
# for i in range(20): # range()可以被迭代 0-9
# print(i)
# range(参数1, 参数2) [参数1, 参数2) 切片
# for i in range(10, 20):
# print(i)
# range(参数1, 参数2, 参数3) [参数1, 参数2) 每隔参数3个位置取一个
# for i in range(10, 20, 3):
# print(i)
# lst = ["周杰伦", "动画城", "大风车", "随便加", "宝宝", "孟孟", "萌萌", "孟萌"]
# for item in lst: # 只能拿到元素. 获取不到索引
# print(item)
# for i in range(len(lst)): # i就是索引 lst[i]元素
# print(i, lst[i])