Python Program to Print a Diamond Star Pattern using For Loop
This example shows, how to print diamond star Pattern.
Example.py
a = int(input("Enter the Diamond rows: ")) for i in range(a): print(" " * (a - i), "*" * (2*i + 1)) for i in range(a - 2, -1, -1): print(" " * (a - i), "*" * (2*i + 1))
Output
Enter the Diamond rows: 10
*
***
*****
*******
*********
***********
*************
***************
*****************
*******************
*****************
***************
*************
***********
*********
*******
*****
***
*