Java, .NET, PHP, PYTHON, ANGULAR, .NET, ML, Data Scince, Testing, CI Tutorials in Easy Languages.

"Best Software Training, Internship, Project Development center of Indore India, Helpline 780506-3968"

Diamond program in python,pyramid program in python.
Half Diamond:-

for i in range(1,4):
    for k in range(3,i,-1):
        print(' ',end='')
    for j in range(0,2*i-1):
        print("*",end='')

    print()


Full Diamond

for i in range(1,4):
    for k in range(3,i,-1):
        print(' ',end='')
    for j in range(0,2*i-1):
        print("*",end='')

    print()
for i in range(1,3):
    for k in range(0,i):
        print(' ',end='')
    for j in range(2*i-1,4):
        print("*",end='')

    print()

Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post