fork download
  1. def f(w,h):
  2. x=[['.']*w for i in[0]*h];i=0
  3. while i<w or i<h:x[~min(i,h-1)][min(i,w-1)]=['#','X'][i<1];i+=1
  4. for i in x:print(''.join(i))
  5. print(max(w,h)-1)
  6.  
  7. f(5,6)
Success #stdin #stdout 0.02s 9984KB
stdin
Standard input is empty
stdout
....#
....#
...#.
..#..
.#...
X....
5