Search
 
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
Name
9+1 =