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




Expert's answer

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!

LATEST TUTORIALS
APPROVED BY CLIENTS