I can't figure out how to make the stars go from 5 back down to 1, printing only 1 star at a time, I did half of it but now I'm confused.

Here's the first part I've done:

#nested for loop #
index = "*"
count = "*"
for index in range(1,2):
    index2="*"
    for index2 in range(1,6):
        print count
        count +="*"

for index in range(1,2,-1):
    index2="*"
    for index2 in range(1,6,-1):
        print count
        count +="*"

I want to do it in reverse now, printing 5 stars down to 1.

"printing 5 stars down to 1"
like this?

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

for i in range(5, 0, -1):          # i start from 5 to 1 (0 not included)
    print i * '*'                        # 5 * '*' == *****, and so on

printing one '*' at a time

for i in range(5, 0, -1):            
    for i2 in range(i):              
        print '*',
    print
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.