sentence = [ "Hello" , "World", "Today is a good", "Day"]
輸出應該是平均水平的話,那麼1.75
我有這個迄今爲止
for k in len(line): // here i am trying to get position 0,1,2,3etc for k
total += len(line[k].split())
return total/len(line)
的錯誤是:'int' object is not iterable
,我在這個網站上看過同樣的問題,但仍然不明白是什麼問題。什麼是寫這個循環的更好方法?
是的,作品。謝謝! – b8ckwith 2014-11-05 20:51:47