Jul-25-2022, 02:56 PM
hello I have to calculate the arithmetic mean in the text (the number of letters divided by the number of sentences). The problem is that when counting letters, it also counts spaces and the result is spooky. How can I easily exclude joints from counting?
Text = input("give text: ")
characters = len(Text)
words = len(Text.split())
a = characters
b = words
division = a/b
print("words in this text hawe ", division, "characters")
Text = input("give text: ")
characters = len(Text)
words = len(Text.split())
a = characters
b = words
division = a/b
print("words in this text hawe ", division, "characters")