From 91d8796de5dfd9cb380e2d2a642e9c93059fa8ff Mon Sep 17 00:00:00 2001 From: deadmarshal Date: Mon, 22 Jul 2024 16:32:56 +0330 Subject: TWC279 --- challenge-279/deadmarshal/python/ch2.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 challenge-279/deadmarshal/python/ch2.py (limited to 'challenge-279/deadmarshal/python/ch2.py') diff --git a/challenge-279/deadmarshal/python/ch2.py b/challenge-279/deadmarshal/python/ch2.py new file mode 100644 index 0000000000..915438046e --- /dev/null +++ b/challenge-279/deadmarshal/python/ch2.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python + +def split_string(s): + vowels = 'aeiouAEIOU' + return sum(s.count(v) for v in vowels) % 2 == 0 + +print(split_string('perl')) +print(split_string('book')) +print(split_string('good morning')) + -- cgit