Tuesday, March 15, 2022

Vowels and Consonants in Python

 A program that will ask the user to give a string and then the program will count the number of vowels and consonants from the in the given string using Python programming language,

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg

Thank you very much for your support.





Program Listing


# vowels_consonants.py
# Jake Rodriguez Pomperada, MAED-IT, MIT
# www.jakerpomperada.blogspot.com and www.jakerpomperada.com
# jakerpomperada@gmail.com
# Bacolod City, Negros Occidental Philippines

print()
print("\tVowels and Consonants in Python");
print()
str=input("\tGive a String : ");
vowels=0
consonants=0

for i in str.lower():
if(i == 'a'or i == 'e'or i == 'i'or i == 'o'or i == 'u'):
vowels=vowels+1;
else:
consonants=consonants+1;

print()
print("\tThe number of vowels:",vowels);
print("\tThe number of consonants:",consonants);
print()
print("\tEnd of Program")
print()

No comments:

Post a Comment