python 中 關於reverse() 和 reversed()的用法介紹

reverse():python 是python中列表的一個內置方法(也就是說,在字典,字符串或者元組中,是沒有這個內置方法的),用於列表中數據的反轉; exp:web lista = [1, 2, 3, 4] lista.reverse() print(lista) 打印結果:svg [4, 3, 2, 1].net 其實,lista.reverse() 這一步操做的返回值是一個None,其做用
相關文章
相關標籤/搜索