Python | Little template....

/ 8 Aug 2013 /

1
2
3
4
5
6
7
8
9
fname = "ncss.txt"

with open(fname) as f:
    for line in f:
        words = line.split()
        for k in words:
            print(k, k.count('EASTS'), k.count('WESTS'), end='-')
        for v in words:
            print()



EASTS versus WESTS
EASTS have scored 25:13
WESTS have scored 26:38
WESTS have scored 40:23
WESTS have scored 42:01
 
Copyright © 2010 M(ath)+me, All rights reserved