Sep-02-2020, 03:34 AM
- create another variable at start to keep count of total number of words
total_words = 0
- strip line feeds from lines before split,
lines = lines.strip()
- split lines into slines
Use a new name saving original for printing
- calculate line length of split line
- add line length to total_words
- print line number, length and lines
- Continue loop
- after loop (not part of loop) calculate and print average line length