Answer to Question #222375 in Python for srikanth

Question #222375
Print Integers - 3

Given an integer 

N. Write a program to print integers from N to 1.

Input

The first line of input is an integer 

N.

Explanation

In the given example, 

N = 5 the integers from 5 to 1 are 5, 4, 3, 2, 1.

Therefore, the output should be 

5
4
3
2
1
Sample Input 1
5
Sample Output 1
5
4
3
2
1
Sample Input 2
3
Sample Output 2
3
2
1

1
Expert's answer
2021-08-09T02:35:19-0400
N = int(input())
for i in range(N):
    print(N-i)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS