Dec-06-2022, 05:10 PM
\n is not a separator. \n is a linefeed or newline character. Every line in the file except the last has a \n tacked on at the end. The separator for this program is a blank line. When the file has a blank line the string is "\n" (blank followed linefeed).
Why are you asking now? This is exactly what you've been doing from the very start. If the line is not blank, convert line to number and do something with the result. Originally you were appending to a long list. Now you are adding to a total.
Why are you asking now? This is exactly what you've been doing from the very start. If the line is not blank, convert line to number and do something with the result. Originally you were appending to a long list. Now you are adding to a total.