小编I_l*_*hon的帖子

Python:error'list'对象没有'sorted'属性

这是我的代码:

#???????????
place=['?????','?????','?????','?????']
print(place)
print(sorted(place))
print(place)

place.sorted(reverse=true)
print(place)
Run Code Online (Sandbox Code Playgroud)

当我运行我的代码时,发生了一些错误。

place.sorted(reverse=true)
Run Code Online (Sandbox Code Playgroud)

或者

sorted(place)
Run Code Online (Sandbox Code Playgroud)

使用第二种方式,我怎么给(reverse=true)

python

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

python ×1