Array Representation Data Structure

  Python

Email

from array import*

array1 = array(‘i’,[30,40,20,30,20,40,30])

if array1[0] / 2 == 0:

print(“this codig working”)
else:

print(“not working”)

array1.insert(1,000000)
array1.remove(0)

print(“this searching postion”,array1.index(30))

array1[4]= 4

for i in array1:

print(i)

total=array1[0]+array1[1]

print(total)

sumall = sum(array1);

print(sumall);

Spread the Code

Leave a Reply

avatar

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
Notify of