+ 1
I am stuck in Average Word Length problem in python...can anyone help plz....code is correct but still showing eror in print
6 Respostas
+ 7
First of all, you should show your attempt by posting your code here. As it is a code coach challenge, we can not help you with coding, but by giving you hints. Thanks!
+ 3
sumit mehta Here for you...
from math import ceil
s=input().split()
c=0
d=0
for i in range(len(s)):
for j in range(len(s[i])):
if(s[i][j]!='?'):
c+=1
d+=1
x=c/d
print(ceil(x))
0
Now that's great advice,thanks Lothar
0
import math
a=str(input())
count=0
for i in range(len(a)):
if(a[i]==" "):
count+=1;
a=((len(a))-count)
v=a/(count+1)
e=math.ceil(v)
print (e)
This is the code....btw that problem related print statement is solved...now I have problem that this code runs but only first case test is not passing...
0
As per example they given... For 5.2 they make it integer to 6 means rounded to ther next int.....so I have used ceil() to satisfy this condition...but in first test case for 3.2 the required output is 3....
Can anyone help
- 1
I'm always getting stuck everywhere,not good advice but still advice I pick a topic from every skill.