How to find the index in Foreach loops in Python

I am working on a python program, where i am iterating a dictionary using a foreach statement.

But during the iteration, on occurrence of some specific event, I need the index number of the element for further processing.

Please guide me how I can get the index number in the following for loop.

dict = {'X': 24, 'Y': 25, 'Z': 26}

for key in dict:
    print(key)