print star pattern in python

 


for i in range (5):
    print("*",end="")

Output
*****

for i in range (5):
    for j in range(5):
        print("*",end="")
    print()

output
***** ***** ***** ***** *****

for i in range (5):
    for j in range(i+1):
        print("*",end="")
    print()

output
* ** *** **** *****

for i in range (5):
    for j in range(5-i):
        print("*",end="")
    print()

output
***** **** *** ** *

-

Post a Comment

Previous Post Next Post