Answer to Question #231121 in Python for Rachna Pal

Question #231121

Assume a text file “coordinate.txt” is already created. Using this file create a PYTHON function to count the number of words having first character capital.


1
Expert's answer
2021-09-01T23:57:12-0400
f = open("Rajeev", "r+")




def count_char(li):
    count = 0
    for item in li:
        if item[0].isupper():
            count += 1
    return count
count = 0
for li in f:
    li = li.split()
    count += count_char(li)


print(count)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS