Python example to Print Half Diamond Star Pattern

num = int(input("Enter the Number: "))
for i in range(0, num):
    for j in range(0, i+1):
        print("*", end="")
    print()
for i in range(1, num):
    for j in range(0, num-i):
        print("*", end="")
    print()

OUTPUT:

Enter the Number: 20
*
**
***
****
*****
******
*******
********
*********
**********
***********
************
*************
**************
***************
****************
*****************
******************
*******************
********************
*******************
******************
*****************

Leave a Comment