Answer to Question #224457 in Python for raj

Question #224457

Given an integer number N as input. Write a program to print the double triangular pattern of N lines using an asterisk(*) character as shown below.There is space after each asterisk character.


Explanation: N = 4 there should be 2 triangle pattern with 4 lines each.


1
Expert's answer
2021-08-09T11:06:31-0400
N = int(input())

for i in range(1,N+1):
    for j in range(i):
        print("*", end=' ')
    print()
print()
for i in range(1,N+1):
    for j in range(i):
        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