Asterisk art in python

前端 未结 5 1092
遇见更好的自我
遇见更好的自我 2020-12-20 21:10

I would like to produce this picture in python!

         *
        **
       ***
      ****
     *****
    ******
   *******
  ********
 *********
**********         


        
5条回答
  •  离开以前
    2020-12-20 21:57

    To be exact, as your picture ends with 10 asterisks, you need.

    for i in range(1, 11):
        print "%10s"%('*' *i)
    

提交回复
热议问题