The problem is i have to print out the average length of words in each lines in a txt documents.
My code so far: i know how to count the number in each line and how many words in each line, but have no idea how to start a average length of words.
My code so far: i know how to count the number in each line and how many words in each line, but have no idea how to start a average length of words.
1 2 3 4 5 |
count = 0 with open ( 'win95coolest.txt' ) as book: for lines in book: count + = 1 print (count,( len (lines.split())), lines) |