fork download
  1. def f(w,h):exec"print'|'+'- '[1<h<%d]*(w-2)+'|';h-=1;"%h*h
  2.  
  3. for test in ((3,3),(5,8),(10,3)):
  4. print test
  5. f(*test)
  6. print ''
Success #stdin #stdout 0.01s 9024KB
stdin
Standard input is empty
stdout
(3, 3)
|-|
| |
|-|

(5, 8)
|---|
|   |
|   |
|   |
|   |
|   |
|   |
|---|

(10, 3)
|--------|
|        |
|--------|