hello, i have a list with some names, and i have to replace wovels by " - "
here is what i tried:
It has to be:
here is what i tried:
list1 = ['john', 'tony', 'luck] def replace_vowel(mlist): vowels = "aeiouy" novowel = "" for char in mlist: if char in vowels: novowel = novowel.replace(char, '-') return mlist print replace_vowel(list1)actually , the output is " None "
It has to be:
Output:['j-hn', 't-n-', 'l-ck']
any idea? thanks !