# 05.20 a
integer_num = 7
for i in range(1, integer_num + 1):
    for j in range(1,i+1):
        print(j,end=" ")
    print()  

在这里插入图片描述

#05.20.b
integer_num = 7
for i in range(integer_num, 0, -1):
    for j in range(1, i + 1):
        print(j, end=" ")
    print()

在这里插入图片描述

# 05.20.c
integer_num = 8
mup_num = 2
for i in range(1, integer_num):
    for k in range(integer_num - i, 0, -1):
        print(k * "", end="  ")
    for j in range(i, 0, -1):
        print(j, end=" ")

    print()

在这里插入图片描述


# 5.20.d  2024.4.2 done this !

integer_num = 7

for j in range(integer_num + 1, 1, -1):
    print((abs(j-9))*"  ", end="")
    for k in range(1, j):
        print(k, end=" ")
    print()

在这里插入图片描述

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部