Answer to Question #234432 in Python for manohar

Question #234432

for i in range(N - 1, 0, -1):

for j in range(1, N - i + 1):

print(' ', end = '')

for l in range(1, 2 * i):

if l == 1 or l == i * 2 - 1:

print('*', end = '')

else:

print(' ', end = '')

print()

covert this program into simple program


1
Expert's answer
2021-09-07T23:21:46-0400
N=int(input("Enter an interger: "))
for i in range(N - 1, 0, -1):
    for j in range(1, N - i + 1):
        print(' ', end = '')
    for l in range(1, 2 * i):
        if l == 1 or l == i * 2 - 1:
            print('*', end = '')
        else:
            print(' ', end = '')
    print()

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS