FOR FLOW

Run Settings
LanguagePython
Language Version
Run Command
#For my_list = ["table", "chair", "shelf", 1, 4] for n in my_list: print(n) print("loop ended") #For with if my_list = ["table", "chair", "shelf", 1, 4] for n in my_list: if type(n) == int: print(n) print("loop ended") # for range for i in range(5): print(i) for i in range(10, 18, 3): print(i) #continue, skip current my_list = ["table", "chair", "shelf", 1, 4] print(my_list) for n in my_list: if n == "chair": continue print(n) #break all loop my_list = ["table", "chair", "shelf", 1, 4] print(my_list) for n in my_list: if n == "chair": break print(n) # finsih the for then else my_list = ["table", "chair", "shelf", 1, 4] print(my_list) for n in my_list: print(n) else: print("The loop is finished") #nested for my_list = ["table", "chair", "shelf", 1, 4] your_list = ["1, 2, 3"] print(my_list) print(your_list) for n in my_list: print(n) for m in your_list: print(m) else: print("The loop is finished")
Editor Settings
Theme
Key bindings
Full width
Lines