Last answered:

13 Nov 2021

Posted on:

03 Nov 2021

1

Resolved: in question 9 sin some if,elif statements we print() empty string

in question 9 in  some if, elif statements we print() empty string
in others we don't
why
star = '*'

for i in range(1,7):
    for j in range(1,6):
        if i == 1 and j < 6:
            print(star,end='')
        elif i == 2 and j == 1:
            print()
            print(star)
        elif i == 3 and j < 5:
            print(star,end='')
        elif i == 4 and j == 1:
            print()
            print(star)
        elif i == 5 and j == 1:
            print(star)
        elif i == 6 and j == 1:
            print(star)

2 answers ( 1 marked as helpful)
Instructor
Posted on:

03 Nov 2021

0

Hey Satthya,

Thank you for your question!

The only purpose of these empty print functions is to place an empty line between the rest of the prints, so that the output is more readable.

Hope this helps!

Kind regards,
Hristina

Posted on:

13 Nov 2021

0

thanks

Submit an answer