In the last post about the python, I have shown how you can create the array by supplying user input values. Now, in this code I am gonna show how you can print the index number of certain value that is supplied by the user. For this I create my own custom array just for learning. Here's the code:
from array import *
MyArray=array('i',[23,45,33,21,87,56,10])
Value=int(input("Enter the value whose index is to be found: "))
i=0
for e in MyArray:
if e==Value:
print(i)
i=i+1
#Another method to find the index
print(MyArray.index(Value))
The output of this code is as follows:

You can also run this code in the online python compiler here.
Upvoted by GITPLAIT!
We have a curation trial on Hive.vote. you can earn a passive income by delegating to @gitplait
We share 80 % of the curation rewards with the delegators.
To delegate, use the links or adjust 10HIVE, 20HIVE, 50HIVE, 100HIVE, 200HIVE, 500HIVE, 1,000HIVE, 10,000HIVE, 100,000HIVE
Join the Community and chat with us on Discord let’s solve problems & build together.