aboutsummaryrefslogtreecommitdiff
path: root/challenge-319/sgreen/python/ch-1.py
blob: f76b60e6e5e5d644ad23a12efa2d149802338780 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env python3

import re
import sys


def word_count(words: list[str]) -> int:
    return sum(1 for word in words if re.search('^[aeiou]', word) or re.search('[aeiou]$', word))


def main():
    result = word_count(sys.argv[1:])
    print(result)


if __name__ == '__main__':
    main()