首页 > 代码库 > 文件操作

文件操作

chang = int(input("请输入长: "))
gao = int(input("请输入高: "))
i = 0
while i < gao:
    j = 0
    while j < chang:
        if i == 0:
            print("#",end="")
        elif i == gao-1:
            print("#", end="")
        else:
            if j ==0:
                print("#",end="")
            elif j == chang-1:
                print("#", end="")
            else:
                print(‘ ‘,end="")
        j+=1
    print(‘‘)
    i += 1

文件操作