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
Science,
1 month ago
Math,
3 months ago
Social Sciences,
3 months ago
Geography,
10 months ago
Math,
10 months ago