samedi 26 mars 2022

what do I need to change for this pyramid to print correctly.. can someone walk me through the process with comments

for i in range(5): #number of rows to print

    for space in range(5-i): #prints 5 spaces decrementing by one for every row
        print(' ',end = '')

    for cols in range(5-space): 
        print('*',end='')

I get lost after my second comment im not sure if the first inner loop will execute completely before the start of the second inner loop.

Aucun commentaire:

Enregistrer un commentaire