Question : deeply nested loops
Answered by : homeless-horse-x3qh5588p25y
n=int(input("enter size : "))
for row in range(0,n): for col in range(0,n): if row == 0 or col == 0 or row==n-col-1: print("*", end="") else: print(end=" ") print()
Source : https://stackoverflow.com/questions/61890667/how-to-print-a-shape-in-python | Last Update : Thu, 30 Sep 21
Question : deeply nested loops
Answered by : homeless-horse-x3qh5588p25y
enter size : 6
******
* *
* *
* *
**
*
Source : https://stackoverflow.com/questions/61890667/how-to-print-a-shape-in-python | Last Update : Thu, 30 Sep 21