-- coding: utf-8 -- import time def test_flag(): flag = False for i in range (0,100): print(‘i==’ + str(i)) for j in range(0,2): time.sleep(1) print(‘j ==’ + str(j)) if i ==2: time.sleep(1) print('i == ’ +str(i) ) flag = True if flag == True: break if name == ‘main’: test_flag()