Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def inside_search(strings: list, target: str) -> list:
- if not isinstance(strings, list):
- raise ValueError('List expected to search')
- if not isinstance(target, str):
- raise ValueError('str expected for search')
- result = []
- for idx, string in enumerate(strings):
- if not isinstance(string, str):
- raise ValueError('only str objects expected in list to search')
- if target in string:
- result.append(idx)
- return result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement