Q. Write a program to count the number of uppercase alphabets present in a text file "Pome.txt".


Answer =


count = 0

file = open("Pome.txt ","r")
sen = file.read()
for i in range ( len(sen) ) :
    if sen[ i ].isupper() :
        count += 1

print("Number of upper case alphabet  : ", count)

file.close()


Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post