I think this is what you want to do:
m, n = 10, 10
for i in range(m):
for j in range(n):
print('*' if i in [0, n-1] or j in [0, m-1] else ' ', end='')
print()
Output:
**********
* *
* *
* *
* *
* *
* *
* *
* *
**********
You can also draw a triangle this way:
m, n = 10, 10
for i in range(m):
for j in range(n):
print('*' if i in [j, m-1] or j == 0 else ' ', end='')
print()
Output:
*
**
* *
* *
* *
* *
* *
* *
* *
**********
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…