Skip to content

Latest commit

 

History

History
39 lines (22 loc) · 436 Bytes

File metadata and controls

39 lines (22 loc) · 436 Bytes

CodeWars Python Solutions


Reversed sequence

Get the number n (n>0) to return the reversed sequence from n to 1.

Example :

n=5 >> [5,4,3,2,1]

Given Code

def reverse_seq(n):
    pass

Solution

def reverse_seq(n):
    return sorted([i for i in range(1, n+1)], reverse=True)

See on CodeWars.com