CS2613/tests/Q3/prefix.py
2022-11-23 10:09:24 -04:00

5 lines
131 B
Python

def with_prefix(prefixes, words):
for prefix in prefixes:
lst = [word for word in words if word.startswith(prefix)]
yield lst