Shortened Solution (8: Anti Vowel) [Spoiler]


Having completed the Codecademy Python course, I'm looking back over my code to see if I can shorten them with acquired knowledge. Here is what I came up with for anti vowel:

def anti_vowel(text):
    word = filter(lambda i: i not in "aeiouAEIOU", text)
    return word


Very clean and concise piece of code! :raised_hands:


EDIT: So I went back and managed to shorten it by a line:

def anti_vowel(text):
    return filter(lambda i: i not in "aeiouAEIOU", text)

Not much but improvements are improvements.


Still impressive, In programming the simplest and most efficient way is most of the time the best way. :slight_smile:

Very DRY :sweat_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.