Given a value 'n', write an algorithm and Python code to print a decreasing pattern as follows. When n is 5, the pattern looks as below: ***** **** *** ** * code example
Example: 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()