+ 4
What's wrong in my code could you tell
text = input() word=text.split() count=0 for i in text: if not i=="": count+=1 averge=(count/len(word)) print (averge)
6 Answers
+ 5
if not i == " " :
edit: you are using empty string instead
+ 3
As Jayakrishnađźđł has pointed out, you have not specified a space in your text.
+ 3
A space in a text is considered to be a character, so it also gets counted.
That is why you must exclude it from your tally
+ 3
Musab Adam
A little code which may help you understand
https://code.sololearn.com/cR8q6PcSDb0A/?ref=app
+ 2
Could you give hint about this reason of this space please
0
what is ur aim? u can write it different too...