diff options
Diffstat (limited to 'challenge-279/packy-anderson/python/ch-2.py')
| -rwxr-xr-x | challenge-279/packy-anderson/python/ch-2.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/challenge-279/packy-anderson/python/ch-2.py b/challenge-279/packy-anderson/python/ch-2.py new file mode 100755 index 0000000000..b0614bba56 --- /dev/null +++ b/challenge-279/packy-anderson/python/ch-2.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +vowels = ['a', 'e', 'i', 'o', 'u'] + +def splitString(str): + return len([ + v for v in list(str.lower()) if v in vowels + ]) % 2 == 0 + +def solution(str): + print(f'Input: @str = "{str}"') + print(f'Output: {splitString(str)}') + +print('Example 1:') +solution("perl") + +print('\nExample 2:') +solution("book") + +print('\nExample 3:') +solution("good morning") |
