Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pyramids reduction
#3
This kind of worked. However,

base_size=input("base_size:" )
base_size=int(base_size)
for r in range(base_size,0,-1):
    for c in range(r+1):
        print('*',end='')
    print()
print()
Output:
base_size:6 ******* ****** ***** **** *** **
It turns it upside down. I need it to stay with the smallest number at the top and keep repeating this pattern till it gets to zero.

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

*
**
***
****

*
**
***

*
**

Something like this.
Reply


Messages In This Thread
Pyramids reduction - by Technoob - Jun-17-2019, 08:38 PM
RE: Pyramids reduction - by Yoriz - Jun-17-2019, 08:48 PM
RE: Pyramids reduction - by Technoob - Jun-17-2019, 09:00 PM
RE: Pyramids reduction - by Yoriz - Jun-17-2019, 09:11 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020