Average word length
Hello, The question is asking to write 3 functions; word_count, letter_count, and average_word_length. word_count should take as input a string. It should return the number of words in the string. letter_count should take as input a string. It should return the number of letters in the string. average_word_length should take as input a string. It should return the average length of the words in the string. You can find the average length by dividing the number of letters by the number of words. Your implementation for average_word_length *must* call the function word_count and letter_count. Here is the code I have written; def word_count(a_string): words = 0 for letter in a_string: if letter == " ": words += 1 words += 1 return words def letter_count(a_string): letters = 0 for letter in a_string: if not letter == "": letters += 1 return letters def average_word_length(a_string): return (letter_count(a_string)/word_count(a_string)) a_string = "Up with the white and gold" print(average_word_length(a_string)) But according to the reviewer, the answer should be 3.5 and I am getting 4.333333. Please advise where I am going wrong.