Question: Write a function countUpper () that takes a string representing a file name as a parameter. The program should read the content of the
Write a function countUpper () that takes a string representing a file name as a parameter. The program should read the content of the file and return the number of words where the first character is an upper-case letter. Hint: there is a built-in function that will check if a string is upper-case. The following shows how the function would behave for several sample files that are included in the zip file with the assignment template: >>> C = countUpper("hope.txt") >>> C 16 >>> countUpper("poppins.txt") 57 countUpper("none.txt") >>> 0 >>>
Step by Step Solution
3.39 Rating (165 Votes )
There are 3 Steps involved in it
The image youve provided shows instructions for writing a Python function called countUpper This fun... View full answer
Get step-by-step solutions from verified subject matter experts
