def value(x):
s = "Since 2012, Champion Data has boxed players in five categories, ranging from 'elite' to 'poor', based on a complicated formula assessing their most recent form. Players who have yet to debut, played only sparingly or are returning from long-term injuries (less than 10 games in two seasons) are placed in a sixth category named, appropriately, '?'. "
The aim is to sum up the indices of the different occurrences of the argument x in the text, and divide by the number of occurrences, and further divide by the length of the text.
I've tried endlessly but can't seem to figure it out.