Professional Documents
Culture Documents
INPUT: (text.txt)
A boy is playing there.
There is a playground.
An aeroplane is in the sky.
Alphabets and numbers are allowed in password.
Computer science is easy to learn
Python programming skills is very useful for us.
The united states is one of the largest country
OUTPUT:
The count of 'is' is 6
The count of 'the' is 3
INPUT: AI.txt :
AI refers to artificial intelligence
it is the intelligence of machines
with AI machines can perform reasoning and problem solving
AI is the simulation of human intelligence by machines
it is the development in the world technology
OUTPUT:
AI_1.txt :
AI refers to artificial intelligence
it is the intelligence of machines
with AI machines can perform reasoning and problem solving
AI is the simulation of human intelligence by machines
AI_2.txt:
it is the development in the world technology
S. Krish Hariharan 12114
CODE:
f=open("story.txt",'r')
s=f.read()
v=c=u=l=o=0
for i in s:
if i.isalpha():
if i.isupper():
u+=1
if i.islower():
l+=1
if i in "AEIOUaeiou":
v+=1
if i not in "AEIOUaeiou":
c+=1
else:
if i.isspace():
pass
else:
o+=1
print("Vowel count:",v)
print("consonants count:",c)
print("uppercase count:",u)
print("Lowercase count",l)
print("other characters count:",o)
f.close()
INPUT: “story.txt”
Ram lives in #23, NEHRU nagar, New Delhi-400 034. his house is near our school.
OUTPUT:
Vowel count: 22
consonants count: 29
uppercase count: 8
Lowercase count 43
other characters count: 14