elements=[3,9,5,33,99]
num=9
for i in range(0,len(elements)):
if num==elements[i]:
print(str(num) + " found at position " + str(i))
Output :
9 found at position 1
Algorithm :
- List the numbers in array
- Specify the number or get the input from the user which number need to find
- Use for loop to find the length of the elements in the list
- Use if condition to find the number is present in the element array
- Finally print the result
Comments :