#Python 3, 104 95 bytes ( feedback from @mbomb007 : -9 bytes)
def d(x,y):return'\n'.join(('|'+('-'*(x-2)if n<1or n==~-y else' '*(x-2))+'|')for n in range(y)) (my first code golf, appreciate feedback)
#Python 3, 104 95 bytes ( feedback from @mbomb007 : -9 bytes)
def d(x,y):return'\n'.join(('|'+('-'*(x-2)if n<1or n==~-y else' '*(x-2))+'|')for n in range(y)) (my first code golf, appreciate feedback)