📌  相关文章
📜  python 以数字方式对字符串列表进行排序 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:32.198000             🧑  作者: Mango

代码示例1
# Example usage:
your_list = ['cmd1','cmd10', 'cmd111', 'cmd50', 'cmd99']
your_list.sort(key=lambda x: int(x[3:]))
print(your_list)
--> ['cmd1', 'cmd10', 'cmd50', 'cmd99', 'cmd111']