It's pretty straightforward. Your goal is to create a function that removes the first and last characters of a string. You're given one parameter, the original string.  You don't have to worry with strings with less than two characters.

Difficulty: introductory

Starter code:

def remove_char(s):
	

Solutions:
def remove_char(s):
    return s[1 : -1]

def remove_char(s):
    return '' if len(s) <= 2 else s[1:-1]

def remove_char(s):
    return s[1:len(s)-1]

remove_char=lambda s: s[1:-1]

def remove_char(s):
    if s == "eloquent":         #confirming the s variable equals the word "eloquent"
        return(s[1:7])          #telling the program if s is "eloquent" print all except first and last letters
    elif s == "country":        #confirming the s variable equals the word "country"
        return(s[1:6])          #telling the program if s is "country" print all except first and last                             
    elif s == "person":         #same as 1,3
        return(s[1:5])          #same as 2,4
    elif s == "place":          #same as 1,3
        return(s[1:4])          #same as 2,4
    elif s == "ok":             #same as 1,3
        return""                #telling the program if s is "ok" don't print anything, ok is only 2 letters
    else:                       #if anything else is entered,
        return(s[1:-1])         #tell the program s is the input without the first and last characters

def remove_char(s):
    s = list(s)
    s.pop()
    s.pop(0)
    return ''.join(s)

def remove_char(s):
    #your code here
    if s is not None and len(s) > 1:
        return s[1:len(s)-1]
    
    return s

def remove_char(s):
    #your code here
    s = s[1:-1]
    return s

def remove_char(s):
    if len(s)>0:
       return s[1:-1]
    else:
       return ''

remove_char = lambda s: s[1:-1] #Lambda is great -Mr. Stupido

def remove_char(s):
    x = s[1:-1]
    return x 

remove_char = lambda _: _[1:-1]


def remove_char(s):
    list_s = list(s)
    list_s.pop()
    list_s.pop(0)
    return ''.join(list_s)

def remove_char(s):
    #your code here
    if len(s) > 2:
        x = s[1:-1]
        return x
    else:
        return ''

def remove_char(s):
    if len(s) > 2:
        return s[1:-1]
    else:
        return ""

def remove_char(s):
    a = list(s)
    a.pop()
    a.reverse()
    a.pop()
    a.reverse()
    return ''.join(a)

def remove_char(s):
    return s.replace(s[0:],s[1:-1]) 

remove_char = lambda x:x[not():-(not())]

def remove_char(s):
    long=len(s)
    s = s[:0] + s[(0+1):]
    s = s[:long-2] + s[(long-1):]
    return s

def remove_char(s):
    return s.split()[0][1:len(s)-1]

def remove_char(s):
    list1 = list(s)
    list1.pop(-1)
    list1.pop(0)
    return "".join(list1) 

def remove_char(s):
    l = list(s)
    del (l[0],l[len(l)-1])
    return "".join(l)

def remove_char(s):
    return s[1:len(s)-1] if len(s) > 1 else s

def remove_char(s):
    return s[1:][:-1]

def remove_char(s):
    return ''.join([list(s)[i] for i in range(1,len(s)-1)])

def remove_char(s):
    lista = list(s)
    del lista[0]
    del lista[-1]
    s = "".join(lista)
    return s

def remove_char(s):
    return "" + s[1:-1] + ""

def remove_char(s: str) -> str:
    return s[1:len(s) - 1]


def remove_char(s):
    r = s[1:]
    r = r[:len(r)-1]
    return r

def remove_char(s):
    l = len(s)
    v = s[1:(l-1)]
    return v

def remove_char(s):
    s_neu=s[1:]
    k=s_neu[:-1]
    return k

def remove_char(s):
    s1=[]
    for x in s:
        s1.append(x)
    s1.pop(0)
    s1.pop(-1)
    s2=""
    for x in s1:
       s2+=x     
    return s2

def remove_char(s):
    beforelastchar=len(s)-1
    news=s[1:beforelastchar]
    return news

def remove_char(s):
    s = s[:0] + "" + s[1:]
    s = s[:-1] + ""
    
    return(s)


def remove_char(s):
    l = list(s)
    nl = [j for i,j in enumerate(l) if i != 0 and i != len(s)-1]
    return ''.join(nl)

def remove_char(s):
    a = [word for word in s]
    return "".join(a[1:-1])

def remove_char(s):
    s_list = []
    for x in s:
        s_list.append(x)
    return "".join(s_list[1:(len(s)-1)])

def remove_char(s):
    new = s[1:]
    new2 = new[:-1]
    return new2

def remove_char(s):
    #your code here
    if len(s)<2:
        return s
    else:
        n=len(s)-1
        return s[1:n]

def remove_char(s):
    #your code here
    b = s[1:-1]
    return str(b)