Program to count the number of capital letters in a file?
Last updated 3 years, 3 months ago | 1496 views 75 5
Python program to count the number of capital letters in a file.
with open(FILE_NAME) as my_file:
count = 0
text = my_file.read()
for character in text:
if character.isupper():
count += 1
print(count)