9.7) Exercise 23 - For Loop
- Write a program using a for loop that prints all the elements of the list one at a time.
- Write a program using nested for loops to display this nested list.
L1=[23,45,67,89,9999.99]
[tippy title="Solution"]
for a in L1: print a
[/tippy]
L2=[[1,2,3],[4,5,6],[[7,8,9][10,11,12]]]
[tippy title="Solution"]
for sublist in L2: for element in sublist: print element
[/tippy]