You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defDiamond(rows):
n=0foriinrange(1, rows+1):
# loop to print spaces forjinrange (1, (rows-i) +1):
print(end=" ")
# loop to print star whilen!= (2*i-1):
print("*", end="")
n=n+1n=0# line break print()
k=1n=1foriinrange(1, rows):
# loop to print spaces forjinrange (1, k+1):
print(end=" ")
k=k+1# loop to print star whilen<= (2* (rows-i) -1):
print("*", end="")
n=n+1n=1print()
# Finally how many rows of dimaoond you want we can specify.rows=5Diamond(rows)
```python