Answer:
def without_end(strg):
if len(strg)>2:
return strg[1:-1]
else:
return strg
Step-by-step 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