Computer Science, asked by apurvA8101, 1 year ago

Printing pattern of 54321 5432 543 54 5 using python

Answers

Answered by Deepak4311
9
Logic for 54321 5432 543 54 5 pattern.
User input - N:
for(i=1; i<=N; i++)
{
for(j=N; j>i; j--)
{
print j value;
}
print new line;
}
This logic will prints the pattern of
5 4 3 2 1
5 4 3 2
5 4 3
5 4
5
Answered by sanjanayadav99
7

Answer:

Explanation:

n=int(input("enter the number: "))

for i in range(n,0,-1):

        for j in range(i,0,-1)

                print(j,end=" ")

        print()

output:-

enter the number:- 5

5  4  3  2  1

4  3  2  1

3  2  1

2  1

1

Similar questions