Python for 循环及作业要求

for i in range(0,10):
    if i < 5:
        print("loop",i)
    else:
        continue
    print("hehe")
  • continue 跳出本次循环, 继续下次循环
  • break 结束循环
for i in range(10):
    print('-----------',i)
    for j in range(10):
        print(j)
        if j >5:
            break