0
I tried several rounding methods for the average value, butevery time atleast one case gets wrong. Any advice is appreciated.
string=input() sub=string.split() count=0 for i in range(len(sub)): count+= len(sub[i]) avg=round(count/len(sub)) print(avg)
3 Answers
+ 1
That's the average word length coding problem, isn't it? Did you notice that one has to remove the punctuation signs first?
+ 1
Here is an example:
https://code.sololearn.com/cnosdi50cJJb/?ref=app
0
Thank you for the valuble answers. It worked after removing the punctuation.