#Python 2, 67 bytes
Python 2, 67 bytes
def f(a,b):c="|"+"-"*(a-2)+"|\n";print c+c.replace("-"," ")*(b-2)+c
Examples
f(3,3)
|-|
| |
|-|
f(5,8)
|---|
| |
| |
| |
| |
| |
| |
|---|
f(10,3)
|--------|
| |
|--------|
#Python 2, 67 bytes
def f(a,b):c="|"+"-"*(a-2)+"|\n";print c+c.replace("-"," ")*(b-2)+c
Examples
f(3,3)
|-|
| |
|-|
f(5,8)
|---|
| |
| |
| |
| |
| |
| |
|---|
f(10,3)
|--------|
| |
|--------|
Python 2, 67 bytes
def f(a,b):c="|"+"-"*(a-2)+"|\n";print c+c.replace("-"," ")*(b-2)+c
Examples
f(3,3)
|-|
| |
|-|
f(5,8)
|---|
| |
| |
| |
| |
| |
| |
|---|
f(10,3)
|--------|
| |
|--------|