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 RĂ©ponses
+ 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