import string data = open('/home/kodingwindow/Weekdays', 'r').read() print("Characters - %s"%(len(data))) print("Lines - %s"%(len(data.splitlines()))) print("Words - %s"%(len(str.split(data))))
cat Weekdays Monday Monday Sunday Wednesday Monday Monday Sunday Wednesday Friday kodingwindow@kw:~$ python3 kw.py Characters - 69 Lines - 9 Words - 9