Python Program To Generate Pattern 16
Write Python Program To Generate Pattern 16
# Write Python Program To Generate Pattern 16 n = 3 i = 1 while(i <= n): k = n while(k > i): print(' ', end = ' ') k = k - 1 j = 1 while(j <= i): print('*', end = ' ') j = j + 1 print('') i = i + 1 m = n - 1 i = 1 while(i <= m): k = 1 while(k <= i): print(' ', end =' ') k += 1 j = 1 while(j <= m - i + 1): print('*', end = ' ') j = j + 1 print('') i = i + 1
Output:
*
* *
* * *
* *
*