Answers for "pattern diamond in python"

6

pattern in python

rows = 6                        #Pattern(1,121,12321,1234321,123454321)
for i in range(1, rows + 1):
    for j in range(1, i - 1):
        print(j, end=" ")
    for j in range(i - 1, 0, -1):
        print(j, end=" ")
    print()
Posted by: Guest on December-21-2020
-2

diamond pattern in python

num = 9

for i in range(1, num+1):
  i = i - (num//2 +1)
  if i < 0:
    i = -i
  print(" " * i + "*" * (num - i*2) + " "*i)
Posted by: Guest on April-21-2021

Code answers related to "pattern diamond in python"

Python Answers by Framework

Browse Popular Code Answers by Language