python打斷外層for循環

for i in range(10):
    print("i = {0}".format(i))
    for j in range(10):
        print("j = {0}".format(j))
        if i > 3 and j > 5:
            break
    else:
        continue
    break

 

發佈了98 篇原創文章 · 獲贊 165 · 訪問量 163萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章