Python-打印图形-方形

打印方形

>>

for i in range(9):
    print("* " * 9)
* * * * * * * * * 
* * * * * * * * * 
* * * * * * * * * 
* * * * * * * * * 
* * * * * * * * * 
* * * * * * * * * 
* * * * * * * * * 
* * * * * * * * * 
* * * * * * * * * 

>>

stars = "* "
empty = "  "
print(stars * 9)
for n in range(7):
    print(stars + empty * 7 + stars)
print(stars * 9)
* * * * * * * * * 
*               * 
*               * 
*               * 
*               * 
*               * 
*               * 
*               * 
* * * * * * * * * 
>>

posted @ 2020-06-02 17:48  大序列  阅读(392)  评论(0编辑  收藏  举报