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
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))
Comments
Leave a comment