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, '?'. "
目的是通過出現的次數來總結不同出現在文本中的參數x
的的索引,和除法,進一步除以的長度內文本。 我嘗試過無數次,但似乎無法弄清楚。的Python - 爲特定的字符工作的字符串
才能添加期望的輸出也 – 2015-04-02 12:40:31
預期產出將是從0-1指示參數x – James 2015-04-02 12:43:50