DEV Community

Discussion on: Daily Challenge #1 - String Peeler

Collapse
 
kerldev profile image
Kyle Jones

In Python:

def peel_string(text):
    if len(text) > 2:
        return text[1:(len(text) - 1)]
    return None

print(peel_string("Testing"))
print(peel_string("Hi"))
print(peel_string(""))