+ 1

Help python

It is necessary to determine the average length of the word MY CODE - text = (input()) print(sum([len(word) for word in text]) / len(text)) Outputs 1.0 need 6.0

3rd Jun 2022, 11:38 AM
Mendeleyka
Mendeleyka - avatar
1 Answer
+ 3
You are not splitting the "text" into words use text.split(" ") this will split the string by spaces.
3rd Jun 2022, 12:10 PM
NoVa
NoVa - avatar