this simple question. have
range(1, 11)[::-1]
which gives me
[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
is there 'cleaner' way generate above list? single function perhaps?
you can use range(10, 0, -1)
this simple question. have
range(1, 11)[::-1]
which gives me
[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
is there 'cleaner' way generate above list? single function perhaps?
you can use range(10, 0, -1)
Comments
Post a Comment