6. Write a program that reads a file, one character at a time, and prints out how many uppercase characters it contains
Posted: Mon May 02, 2022 11:38 am
write a program that reads a file, one character at a time, and prints out how many uppercase characters it contains and how many lowercase characters it contains
6. Write a program that reads a file, one character at a time, and prints out how many uppercase characters it contains and how many lowercase characters it contains. countchars.py 1 numUppercase = 0 2 numLowercase = 0 3 4 filename input("Input filename: ") 5 infile = open(filename, "r") 6 7 8 9 print("# of uppercase characters:', numUppercase) 10 print("# of lowercase characters:', numLowercase) CodeCheck Reset
6. Write a program that reads a file, one character at a time, and prints out how many uppercase characters it contains and how many lowercase characters it contains. countchars.py 1 numUppercase = 0 2 numLowercase = 0 3 4 filename input("Input filename: ") 5 infile = open(filename, "r") 6 7 8 9 print("# of uppercase characters:', numUppercase) 10 print("# of lowercase characters:', numLowercase) CodeCheck Reset