CS2613/tests/Q3/prefix.py

5 lines
131 B
Python
Raw Normal View History

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