Ad

Just thought using Boolean operators were more efficient than the filter function.

Edit: after a bit of testing, I see there isn't much diffenrence.

Code
Diff
  • # Avoids use of filter() function
    disemvowel = lambda x : ''.join(l * (l.lower() not in 'aeiou') for l in x)
    • disemvowel=lambda s: ''.join(filter(lambda x: x.lower() not in "aeiou", s))
    • # Avoids use of filter() function
    • disemvowel = lambda x : ''.join(l * (l.lower() not in 'aeiou') for l in x)