1. 程式人生 > >python continue 用法

python continue 用法

count = 1
while count <10:
    if count ==7:
        count=count + 2
        continue
    else:
        count=count+0.5
    print(count)

1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
6.5
7.0
9.5
10.0
continue終止這段迴圈,開始下端迴圈