我试图排序以下混合的int和字符串列表,但改为获取TypeError.我想要的输出顺序是排序整数然后排序字符串.
x=[4,6,9,'ashley','drooks','chay','poo','may']
>>> x.sort()
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
x.sort()
TypeError: '<' not supported between instances of 'str' and 'int'
Run Code Online (Sandbox Code Playgroud)