Loop Lists

Run Settings
LanguagePython
Language Version
Run Command
fruits = ["Apple","Banana","Cherry"] print("print Loop through a list :") print("---------------------------------------") for fruit in fruits: print(fruit) print("") print("print Loop through the index numbers") print("---------------------------------------") for fruit in range(len(fruits)): print(fruits[fruit]) print("") print("print loop using While Loop") print("---------------------------------------") i = 0 while i < len(fruits): print(fruits[i]) i = i+1 print("") print("Loop using List Comprehension") print("---------------------------------------") [print(fruit) for fruit in fruits] print("")
Editor Settings
Theme
Key bindings
Full width
Lines