Using python, How can I make a pyramid using for loops?

后端 未结 3 1690
感情败类
感情败类 2020-12-12 05:39

I\'ve been having trouble in one of my classes with this problem, I can\'t quite figure it out. This is what we were asked to do.

\"Write a program that only has one

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-12 06:23

    for x in range(1,6+1):
        print ('Y'*x)
    

    You can replace 6 with the number of rows.

提交回复
热议问题