import array
arr = array.array('i', [1, 2, 3, 1, 2, 5])
print ("The new created array is : ", end ="") for i in range (0, 6): print (arr[i], end =" ")
print ("\r")
print ("The index of 1st occurrence of 2 is : ", end ="") print (arr.index(2))
print ("The index of 1st occurrence of 1 is : ", end ="") print (arr.index(1))
import array as arr
a = arr.array('i', [1, 2, 3])
print ("The new created array is : ", end =" ") for i in range (0, 3): print (a[i], end =" ") print()
b = arr.array('d', [2.5, 3.2, 3.3])
print ("The new created array is : ", end =" ") for i in range (0, 3): print (b[i], end =" ")