How to reverse the element in list without the reverse method

>>l = [1,2,3,4,5]
>>> l
[1, 2, 3, 4, 5]
>>> l[::-1]
[5, 4, 3, 2, 1]
>>>

No comments:

Post a Comment