Skip to content

Latest commit

 

History

History
54 lines (30 loc) · 637 Bytes

Vowel_remover.md

File metadata and controls

54 lines (30 loc) · 637 Bytes

CodeWars Python Solutions


Vowel remover

Create a function called shortcut to remove all the lowercase vowels in a given string.

Example

shortcut("codewars") # --> cdwrs
shortcut("goodbye")  # --> gdby

Don't worry about uppercase vowels.


Given Code

def shortcut( s ):
    pass

Solution 1

def shortcut( s ):
    return "".join([char for char in s if char not in "aeiou"])

Solution 2

def shortcut(s):
    return s.translate(None, 'aeiou')

See on CodeWars.com