import os import sys c = 0 with open(sys.argv[1], 'r') as f: for line in f: for char in line: if ':' in char: c+=1 print (c)