0
What's wrong with my code?
I try to solve average world lenght problem. I got 4/5. I just wrong at test 1. I count it manually and get 3,..... If it rounded up, its must be 4. Why the true output is 3? This is my code x = input() y = x.split(" ") n = int(len(y)) sum = 0 for i in y: a = len(i) sum = sum + int(a) print((sum//n)+1)
2 ответов
0
A word may contain a punctuation, it doesn't count into the length of that word. For instance, the word 'abc.;,' has a length of 3 not 6.
0
Thanks a lot, i will try again