DEV Community

loading...

Discussion on: Daily Challenge #1 - String Peeler

Collapse
tblanshard profile image
Tallie

My solution using Python and list comprehension :)

def stringPeeler(string_to_peel):
    if len(string_to_peel) > 2:
        return "".join([x for i, x in enumerate(list(string_to_peel)) if (len(string_to_peel) - 1) > i > 0])
    else:
        return None