+ 1

Python 3: error message: Sorted & reversed

Hi all, I am a beginner in Python and i am training myself to be pro in using function. I encountered a little problem in one code, and i hope the expert in this forum can guide me through: here's the code: album_list=(1998,2004,1985,1983,1994) sorted_list=sorted((album_list),reversed=False) print(sorted_list) Error: Traceback (most recent call last): File "..\Playground\", line 42, in <module> sorted_list=sorted((album_list),reversed=False) TypeError: 'reversed' is an invalid keyword argument for sort() can anyone explain why?

16th Sep 2018, 5:48 AM
Li Hua Yap
Li Hua Yap - avatar
1 Antwort
+ 5
it's not reversed, it is reverse.
16th Sep 2018, 6:37 AM
Enzo Falcon
Enzo Falcon - avatar