W WolfCode · CSC 141

Count Lines

数行

≈ 15 min · python-file-io python-loops · Open in WolfCode

One line of body. The lesson is the choice between sum(1 for _ in f) and the explicit loop.

Python · runnable