Given a string, return a version without the first and last char, so "Hello" yields "ell". The string length will be at least 2. without_end('Hello') → 'ell' without_end('java') → 'av' without_end('coding') → 'odin'

Respuesta :

ijeggs

Answer:

def without_end(strg):

   if len(strg)>2:

       return strg[1:-1]

   else:

       return strg

   Explanation:

Given above is a function in Python for solving this problem, we can try different output for this program by calling this function in a print statement

print(without_end ("hello")) output ell

print(without_end ("java")) output av

print(without_end ("coding")) output odin