CJCoding With Joseph
15free / daySign inCreate account

Count The Lines

The write step stores three fruit names, one per line, in fruit.txt. Open the file again in read mode, collect its lines with f.readlines() (one string per line, newline included) into lines and print how many there are: one number on its own line. There is no input.

Expected Output:

3

= newline. The output ends with a newline — print one after the last line.

Hints3 available
Topics:
Files
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.