Help, pls. Average in words.
I'm trying to solve the task "Average in words", but all the time i can't pass two last tests and I can't see why. In PyCharm my program works. Here the task: "You are in a college level English class, your professor wants you to write an essay, but you need to find out the average length of all the words you use. It is up to you to figure out how long each word is and to average it out." Here is my decision: https://www.sololearn.com/coach/73?ref=app from math import ceil words = input() letters = 0 words_temp = '' words_lst = [] for i in words: if i.isalpha() or i in '\'`': # for words like "I'm, you're, don't" and etc. if i not in '\'`': words_temp = words_temp + i letters += 1 elif words_temp != '': words_lst.append(words_temp) words_temp = '' print(ceil(letters / len(words_lst)))