0
code coach in community
In category ānormalā thereās a problem statement named āaverage word lengthā. Itās test case 1 result is given wrong. Mods please check and confirm.
4 Answers
+ 7
chess doctor ,
please link your code here, also give a description that is a bit more specific to youd issue.
+ 5
chess doctor ,
this is a part of the task description that has not been taken into account:
> remove all punctuation
> *round up* to the nearest whole number
try to apply this to your code. check also the complete if... else... conditional if you really need it.
+ 2
a=input()
a=a.split(" ")
s=0
for i in a:
s+=len(i)
avg=s/len(a)
if avg<=round(avg):
print(round(avg))
else:
print(round(avg)+1)
This is the code for average word length. It is the problem statement in āmediumā catagory of code coach in community section.
The issue is that after running this code all test cases except ātest case 1ā are right. āTest case 1ā shows wrong answer in the app. Please change the answer with the right one.
+ 1
Thanks lothar