DEV Community

loading...

Discussion on: Daily Challenge #1 - String Peeler

Collapse
pochirajuanirudh profile image
pochirajuAnirudh

Python 3

def remove_first_and_last_characters(input_string):
    if len(input_string) < 3 or type(input_string) != str:
        return "invalid"
    return input_string[1:-1]
Forem Open with the Forem app