Generate countdown
Problem to Generate countdown in given number.
Example-1:
Input : n = 5 Output : [5, 4, 3, 2, 1, 0]
Example-2:
Input : n = 7 Output : [7, 6, 5, 4, 3, 2, 1, 0]
Solution
n = 5 l = [] for i in range(n,-1,-1): l.append(i) print(l)
Output
[5, 4, 3, 2, 1, 0]