Solution:
Yes, you can easily read a text file and count the line from it by using the .split() function and a for-loop.
Check the code snippet below:
file = open("work.txt","r")
Count = 0
Content = file.read()
LineList = Content.split("\n")
for n in LineList:
if n:
Count += 1
print("This is the number of lines in the file")
print(Count)
This should help you. Thanks.