I am new to python so all help would be highly appreciated! I have learnt to use the enumerate method in my code, which gives a list tuples e.g. 'i like football' giving the word football position '3'. My problem is that Once I have the list and the code written out with enumerate function, I am trying to give the number given an ordinal suffix, e.g. '3' being given 'rd' and '2' being given 'nd'. Here is my code so far:
word = str(raw_input("Enter Word: "))
food = " i like computer science"
food2 = food.split()
for (num, x) in enumerate(list(food2)):
if word == x:
print num