Answers for "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: ***** **** *** ** *"

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

Code answers related to "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: ***** **** *** ** *"

Python Answers by Framework

Browse Popular Code Answers by Language