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()
def count_upper():
ReplyDeletef=open('pome.txt',r)
data=x.read()
count=0
for c in data():
if c.isupper():
count=count+1
print('total upper case's,data)
f.close()
This can be easy and helpful
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )