I want to find the index of an array like 3,4,7,8,11,12,14....using python
To find index,I am using below-
alist =[3,4,7,8]
x = int (input))
if x in alist:
print alist.index(x)
The length of array is not fixed. How do I find index for nth value in array. Do I pass a variable to define array or something? Please help