# Read a text file and display the number of vowels/consonants/uppercase/lowercase characters in the file.
f=open("ram.txt")
u=s=v=c=0
data=f.read()
for i in data:
if i.isalpha():
if i.isupper():
u+=1
if i.islower():
s+=1
if i.lower() in 'aeiou':
v+=1
else:
c+=1
print("Totalof uppercase is => ",u)
print("Totalof lowercase is => ",s)
print("Totalof vowels is => ",v)
print("Totalof consonants is => ",c)
f.close()
No comments:
Post a Comment
for more information please share like comment and subscribe