def remove_blank_spaces ( syllables : List [ str ] ) -> List [ str ] : cleaned = [ ] for syl in syllables : if syl == " " or syl == '' : pass else : cleaned . append ( syl ) return cleaned
how to remove blank spaces from lists python
Given a list of letters remove any blank spaces or empty strings .
def remove_blank_spaces(syllables: List[str]) -> List[str]:
    """
    Given a list of letters, remove any blank spaces or empty strings.

    :param syllables:
    :return:

    >>> remove_blank_spaces(['', 'a', ' ', 'b', ' ', 'c', ''])
    ['a', 'b', 'c']
    """
    cleaned = []
    for syl in syllables:
        if syl == " " or syl == '':
            pass
        else:
            cleaned.append(syl)
    return cleaned