im trying to create a function that does the same thing as the built in list opperation for index with out using the built in command for it.
what i mean is i cant have a list lets say myList=[1,2,3,4,5] i then cant simply go
mylist.index(3)
any idea on how i would go about doing this, im lost on this one?

Here is advanced version, try to understand the logic and do regular loop of it if generator is too unfamiliar:

my_list=[1,2,3,4,5]
print my_list.index(3)
print next(index for index, value in enumerate(my_list) if value==3)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.