Python Program To Generate Pattern 18
Write Python Program To Generate Pattern 18
# Write Python Program To Generate Pattern 18 n = 5 i = 1 mid = (n//2) + 1 while(i <= n): j = 1 while(j <= n): if(i == mid or j == mid): print('*', end = ' ') else: print(' ', end = ' ') j = j + 1 print('') i = i + 1
Output:
*
*
* * * * *
*
*