Write a program with a user defined program with string as a parameter which replaces all
vowels in the string with '*'.
Answers
Answered by
4
Question:- Write a program with a user defined program with string as a parameter which replaces all vowels in the string with '*'.
Answer:- #Function to replace all vowels in the string with '*' def replaceVowel(st): #Create an empty string newstr = '' for character in st: #Check if next character is a vowel if character in 'aeiouAEIOU': #Replace vowel with * newstr += '*' else: newstr += character return newstr #End of function st = input("Enter a String:
Similar questions
Economy,
26 days ago
Math,
26 days ago
Math,
1 month ago
Social Sciences,
1 month ago
Math,
8 months ago