在字符串中的数值后排序列表

DSF*_*DSF 3 python sorting

我有一个列表,其中每个项目的格式为"标题,运行时",例如"Bluebird,4005"

我如何根据每个项目的字符串的运行时部分在Python中对该列表进行排序?

有没有办法在不使用正则表达式的情况下执行此操作?

the*_*eye 10

words_list = ["Bluebird, 4005", "ABCD, 1", "EFGH, 2677", "IJKL, 2"]
print sorted(words_list, key = lambda x: int(x.split(",")[1]))
# ['ABCD, 1', 'IJKL, 2', 'EFGH, 2677', 'Bluebird, 4005']
Run Code Online (Sandbox Code Playgroud)