# numchar1.py
# Written by Todd Wareham for CS 2500
"""
Given the name of a textfile and a character c as command-line arguments, computes and
 prints the number of occurences of c in the file.

This version is implemented using a for-loop.
"""

import sys

f = open(sys.argv[1], "r")
line = f.read()
f.close()

c = sys.argv[2]

numC = 0
for x in line:
    if (x == c): numC += 1

print "Num", c, "=", numC

