Useful Python 3 Idioms. You can reverse a list by using [::-1] : a = [1, 2, 3, 4, 5] print(a[::-1]) # [5, 4, 3, 2, 1]. Also works on both strings and bytes:
確定! 回上一頁