Saturday, April 9, 2016

Remove Vowels in Python

A simple program that  I wrote using Python as my programming language that will ask the user to give a word or a sentence and then our program will remove the vowels in the given word or a sentence.

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.



Sample Program Output


Program Listing


def my_program():
   print()
   print("REMOVE VOWELS PROGRAM")
   print()
   str = input("Enter a String : ")
   print()
   vowels = ['a', 'e', 'i', 'o', 'u']
   result = ''
   for letter in str.lower():
      if letter not in vowels:
       result += letter
   print("The result is " ,result.upper(),".")
   print("\n");
   repeat = input('Do you want to continue ? (Y/N) : ')

   if repeat.upper() == "N":
       print("\n")
       print("END OF PROGRAM")
       quit
   if repeat.upper() == "Y":
       my_program()

if __name__ == '__main__':
       my_program()



No comments:

Post a Comment