In the tutorial video I was watching the range used in for loop was "range(len(l))" which successfully reversed the list.
But I guess simply putting " l " will solve the purpose and it didn't can someone please tell me why is that?
def reversed_list(l):
rev = []
for i in l:
l_popped = l.pop()
rev.append(l_popped)
return rev
SAMPLE_LIST = [1,2,3,4]
print(reversed_list(SAMPLE_LIST))
OUTPUT:
[4, 3]