a python function called replacer() that takes two strings as arguments. Argument1: A sentence where you have to make the changes. Argument2: A word with the values either “vowel” or “consonant”. Your function should replace the characters of the sentence with “V” or “C” depending on the 2nd argument. If the word is “vowel”, then replace all the vowels with “V”. If the word is “consonant”, then replace all the consonants with “C”. [You are not allowed to use the replace() function] Function call1: replacer("It is MAT110 final", "vowels") Sample Output1: Vt Vs MVT110 fVnVl
Write a python function called replacer() that takes two strings as
arguments.
Argument1: A sentence where you have to make the changes.
Argument2: A word with the values either “vowel” or “consonant”.
Your function should replace the characters of the sentence with “V” or “C”
depending on the 2nd argument. If the word is “vowel”, then replace all the
vowels with “V”. If the word is “consonant”, then replace all the
consonants with “C”.
[You are not allowed to use the replace() function]
Function call1:
replacer("It is MAT110 final", "vowels")
Sample Output1:
Vt Vs MVT110 fVnVl
Function call2:
replacer("It is CSE110 final", "consonants")
Sample Output 02:
IC iC CCE110 CiCaC
Trending now
This is a popular solution!
Step by step
Solved in 3 steps