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.

10th Jan 2023, 5:26 AM
chess doctor
chess doctor - avatar
4 Answers
+ 7
chess doctor , please link your code here, also give a description that is a bit more specific to youd issue.
10th Jan 2023, 7:49 AM
Lothar
Lothar - avatar
+ 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.
11th Jan 2023, 7:24 PM
Lothar
Lothar - avatar
+ 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.
10th Jan 2023, 3:13 PM
chess doctor
chess doctor - avatar
+ 1
Thanks lothar
12th Jan 2023, 4:11 AM
chess doctor
chess doctor - avatar