new to python here. I am trying to write a program that calculate the average word length in a sentence and I have to do it using the .split command. btw im using python 3.2
def main():
sentence = input('Enter the sentence: ')
SumAccum = 0
for ch in sentence.split():
character = len(ch)
SumAccum = SumAccum + character
average = (SumAccum) / (len(sentence.split()))
print(average)