For example if my text file is:
blue green yellow black
Here there are four lines and now I want to get the result as four. How can I do th
count=0 with open ('filename.txt','rb') as f: for line in f: count+=1 print count