num = eval(input("请输入一个整数:")) for i in range(1, num + 1): for j in range(num-i, 0, -1): print(" ", end=" ") for j in range(i, 1, -1): print(j, end=" ") for j in range(1, i+1): print(j, end=" ") print(" ")
显示
num = eval(input("请输入一个整数:")) for i in range(1, num + 1): for j in range(num-i, 0, -1): print(" ", end=" ") for j in range(i, 1, -1): print(j, end=" ") for j in range(1, i+1): print(j, end=" ") print(" ")
显示