Skip to content

Latest commit

 

History

History
33 lines (18 loc) · 472 Bytes

Regexp_Basics_is_it_a_vowel.md

File metadata and controls

33 lines (18 loc) · 472 Bytes

CodeWars Python Solutions


Regexp Basics - is it a vowel?

Implement the function which should return true if given object is a vowel (meaning a, e, i, o, u), and false otherwise.


Given Code

def is_vowel(s):
    pass

Solution

def is_vowel(s):
    return s.lower() in ["a", "e", "i", "o", "u"] if len(s) > 0 else False

See on CodeWars.com