Professional Documents
Culture Documents
Python Exp 6
Python Exp 6
Laboratory -
Grade and
Subject Teacher’s
Signature
Experiment 06
Number
Code:
import array as arr
found=0
count=0
sizeo = int(input("Enter number of elements of your
array : "))
a=arr.array('i',[])
while(sizeo > 0):
enter = int(input())
a.append(enter)
sizeo = sizeo -1
b = int(input("Enter element to be searched : "))
for i in a:
count+=1
if b == i:
found=1
break
if found == 1:
print("Element found at",count,"position")
else:
print("Element not found")
Output: