DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
python getting line length using list comprehension
num_of_lines = sum(1 for l in open('my_file.txt')) print(num_of_lines)
Source by www.programiz.com #
PREVIOUS
NEXT
Tagged:
#python
#line
#length
#list
#comprehension
ADD COMMENT
Topic
COMMENT
Name
9+1 =
Submit