Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def join_nullable(l: List[str], sep: str) -> str:
- """
- Filter out None in a list and join the remaining strings.
- Example:
- Input: l=['a', None, 'c'], sep=' '
- Output: 'a c'
- :param l: list of strings
- :param sep: separator
- """
- return sep.join(filter(lambda i: bool(i), l))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement