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

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

1 Expert Approved Answer
Step: 1 Unlock

The image youve provided shows instructions for writing a Python function called countUpper This fun... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!