+ 1
Average word length not accepting solution
import math sentence = input () lengths = 0 amount = 0 for word in sentence. split(' '): lengths += len(word) amount+=1 print(math.ceil(lengths / amount)) The example turns 5.2 into six, so it *has* to use ceil right? Why is this code not accepted? :S
3 Réponses
+ 1
From the description: "Remove all punctuation".
+ 2
BTW you don't need to say sentence.split(' ') because ' ' is the default split character. Just say sentence.split() 🙂
+ 2
Thank you! I must have not read the part where punctuation needed removing ^^ that was it!