def extract_string(str, l): result = [e for e in str if len(e) == l] return result