Important Notice:

Course Content
NumPy Basic in Python (Chapter-13) M3-R5
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])

 

 

 

 

error: Content is protected !!