Answer to Question #323165 in Python for sadhana

Question #323165
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. using while loop




1
Expert's answer
2022-04-04T02:40:57-0400
N = int(input())

pattern = []
for i in range(1, N + 1):
    pattern.append(' '.join(['*' for _ in range(i)]))
print('\n'.join(pattern))
print('\n'.join(pattern))

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