Programming Pandit

c/c++/c#/Javav/Python


Latest Update

Monday, November 23, 2020

Python program to count number of vowels present in a file by G Krishna Chauhan

Source Code


 f=open("demo.txt")

str=f.read()


count=0

for i in str:

    if i=='a' or i=='e' or i=='i' or i=='o' or i=='u':

        count+=1

    

print(count)

f.close()



OUTPUT

this is python programming and PHP programming.

10




1 comment:

  1. This blog is so nice to me. I will keep on coming here again and again. Visit my link as well.. free word counter

    ReplyDelete