Python:error';列表';对象没有属性';已排序';
这是我的代码:Python:error';列表';对象没有属性';已排序';,python,Python,这是我的代码: #这是一个有关旅行的程序 place=['北京天安门','西安兵马俑','香港游乐园','日本秋叶原'] print(place) print(sorted(place)) print(place) place.sorted(reverse=true) print(place) 当我运行代码时,发生了一些错误 place.sorted(reverse=true) 或 使用第二种方法,我如何给出(reverse=true)?只需使用排序(place,reverse=true
#这是一个有关旅行的程序
place=['北京天安门','西安兵马俑','香港游乐园','日本秋叶原']
print(place)
print(sorted(place))
print(place)
place.sorted(reverse=true)
print(place)
当我运行代码时,发生了一些错误
place.sorted(reverse=true)
或
使用第二种方法,我如何给出
(reverse=true)
?只需使用排序(place,reverse=true)
它要么是排序的
(不在原地)要么是列表。排序
(在原地)。在这两种情况下,它们都接受一个
reverse`关键字参数您可以通过阅读错误消息和文档,甚至只是在python中搜索“python list sort reverse”,轻松解决这个问题,True和True没有什么不同??我认为这是正确的。非常感谢。非常感谢!这是我的错误,我的真实是真实的。现在我知道真实是真实的。
sorted(place)