aboutsummaryrefslogtreecommitdiff
path: root/challenge-279/zapwai/python/ch-2.py
blob: b8b25daeebeb31c4250506a43b20ac6634917fd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
def is_vowel(c):
    if c == 'a' or c == 'e' or c == 'i' or c == 'o' or c == 'u':
        return True
    return False

def proc(mystr):
    print("Input: mystr =", mystr)
    cnt = 0
    for c in list(mystr):
        if is_vowel(c):
            cnt += 1
            
    if cnt % 2 == 0:
        print("Output: true")
    else:
        print("Output: false")
    
mystr = "perl"
proc(mystr)
mystr = "book"
proc(mystr)
mystr = "goodmorning"
proc(mystr)