Header Ads

Python Program to Print Pattern



Example: Code Program using For Loop


size = int(input("Enter Size:"))
for i in range(size, 0, -1):
   
for j in range(i, 0, -1):
     
print(j, end=" ")
   
print()

Example: Code Program using While  Loop


size = int(input("Enter Size:"))

i = size

while i > 0:

    j = i

    while j>0:

      print(j, end=" ")

      j = j-1

    i = i-1

    print()


No comments

Powered by Blogger.