I have the following code, which try to sort list with its index in python3:
myList = [1,3,4,5,6]
sorted((e,i) for i,e in enumerate(myList))
above code work fine. But when I try to reverse the order by
sorted((e,i) for i,e in enumerate(myList),reverse=True)
I get
SyntaxError: Generator expression must be parenthesized if not sole argument
What is going here? Thanks