debugger
answered Aug 8 '21 00:00
using the reversed function to reverse the list
reversed(seq)
Return a reverse iterator. seq must be an object
x=['a','b','31','4','e','f']
print(list(reversed(x)))
reversed(x) returns list_reverseiterator object so need to convert to list again by list() function
above code have print reverse the list