输出一个矩阵,但这次是中空的

lie=int(input('lie:'))
hang=int(input('hang:'))
phang=1
while phang<=hang:
    plie=1
    if phang==1 or phang==hang:
        while plie<=lie:
            print('*',end='')
            plie+=1
    while plie<=lie:
        if plie==1 or plie==lie:
            print('*',end='')
        else:print(' ',end='')
        plie+=1
    phang+=1
    print()
View Code
原文地址:https://www.cnblogs.com/xusuns/p/7896279.html