0

Can we use readlines function to count no. of new line character in files in python?

Question is regarding file in python.

30th Jan 2020, 11:44 AM
Amey Godse
Amey Godse - avatar
1 ответ
+ 5
with open('file.txt') as f: print(len(f.readlines()))
30th Jan 2020, 11:55 AM
Aymane Boukrouh
Aymane Boukrouh - avatar