About Lesson
Accessing Array Elements using for loop:-
i. Without index number:-
from array import * ar=array(‘i’,[10,20,30,40,50]) for i in ar: print(i) |
ii. With index number:-
from array import * ar=array(‘i’,[10,20,30,40,50]) l=len(ar) for i in range(l): print(ar[i]) |