*组合图形合集

"""
*****
*****
*****
*****
*****
"""
wai=1
while wai<=5:
    nei=1
    while nei<=5:
        print("* ",end="")
        nei+=1
    wai+=1
    print()
"""        wai    nei
*           1     1
**          2     12
***         3     123
****        4     1234
*****       5     12345
                   左 1  右边界 <=wai
"""
print("+++++++++++++++++++++++++++++++++++++++")
wai=1
while wai<=5:#外循环控制行
    nei=1
    while nei<=wai:
        print("*",end="")
        nei+=1
    wai+=1
    print()
"""
1
22
333
4444
55555
1
12
123
1234
12345
"""
wai=1
while wai<=5:
    nei=1
    while nei<=wai:
        print(wai,end="")
        nei+=1
    wai+=1
    print()
print("=====================================")
wai=1
while wai<=5:
    nei=1
    while nei<=wai:
        print(nei,end="")
        nei+=1
    wai+=1
    print()
"""      wai   nei
*        1      1
**       2      12
***      3      123
****     4      1234
*****    5      12345
             nei<=wai

    *    1      5      nei>=6-wai
   **    2     45
  ***    3    345
 ****    4   2345
*****    5  12345
                      nei>=wai
*****    1   12345
 ****    2    2345
  ***    3     345
   **    4      45
    *    5       5
                      nei<=6-wai
*****    1   12345
****     2   1234
***      3   123
**       4   12
*        5   1
"""
wai=1
while wai<=5:
    nei=1
    while nei<=5:
        if nei<=wai:
            print("*",end="")
        else:
            print(" ",end="")
        nei+=1
    wai+=1
    print()
print("+++++++++++++++++++++++++++++++++++")
wai=1
while wai<=5:
    nei=1
    while nei<=5:
        if nei>=6-wai:
            print("*",end="")
        else:
            print(" ",end="")
        nei+=1
    wai+=1
    print()
print("+++++++++++++++++++++++++++++++++++")
wai=1
while wai<=5:
    nei=1
    while nei<=5:
        if nei>=wai:
            print("*",end="")
        else:
            print(" ",end="")
        nei+=1
    wai+=1
    print()
print("+++++++++++++++++++++++++++++++++++")
wai=1
while wai<=5:
    nei=1
    while nei<=5:
        if nei<=6-wai:
            print("*",end="")
        else:
            print(" ",end="")
        nei+=1
    wai+=1
    print()
"""          wai     内
   *           1     4
  ***          2    345
 *****         3   23456
*******        4  1234567
                 左边界 < x < 右边界
                nei>=5-wai  nei<=wai+3
四行七列
"""
wai=1
while wai<=4:
    nei=1
    while nei<=7:
        if nei>=5-wai and nei<=wai+3:
            print("*",end="")
        else:
            print(" ",end="")
        nei+=1
    wai+=1
    print()
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值