y = 384
xType = 3
This is so short, even Stack Overflow did not allow me to submit such a short answer:
This will return element from
y corresponding to the position of
2 or any other given value from within
Hope it helped :)
Ps. Indeed dictionaries may be something you need. Try using them.