【发布时间】:2015-07-10 18:20:01
【问题描述】:
我有一些代码:
def params_to_list(x, y, z):
"""(object, object, object) -> list
Return a list containing x, y and z, in order.
>>> params_to_list('hello', "month", 3)
['hello', 'month', 3]
"""
我需要创建一个函数。我尝试使用sorted 方法,但它返回错误:
builtins.TypeError:不可排序的类型:int()
【问题讨论】:
标签: python string list sorting numbers