- 1

In "Average Word Length" code

from math import ceil s = (input()).split() l=0 #len n=0 #number of word for word in s: l=l+len(word) n=n+1 a = l/n #average print(ceil(a)) Help me in this code I get 4/5 test cases are passed. Only one failed

10th Jan 2020, 6:53 AM
Ashwin - avatar
3 Answers
10th Jan 2020, 7:02 AM
Mihai Apostol
Mihai Apostol - avatar
+ 4
You need to check whether each character is alphabet or not because the question says you need to count the average word length of alphabets only.....
10th Jan 2020, 7:10 AM
Shobhith J B
Shobhith J B - avatar
- 2
Thank you friends now I fixed it https://www.sololearn.com/coach/73?ref=app
10th Jan 2020, 11:17 AM
Ashwin - avatar