Python Program to print star(*) rhombus of side length 3.


n=3

j=n-1

print(' '*(n)+'*')

for i in range(1,2*n):

    if i>n:

        print(' '*(i-n)+'*'+' '*(2*j-1)+'*')

    else:

        print(' '*(n-i)+'*'+' '*(2*i-1)+'*')

if n>1:

    print(' '*n+'*')




Comments

Some popular posts

Python Program that computes the net amount of a bank account based a transaction log from console input.