poros
10/4/2015 - 1:04 PM

Find index of an item in a list

Find index of an item in a list

for i, c in enumerate(shuffled_numbers):
    if x == 2:
        return i

shuffled_numbers.index(2)