可以使用Python内置的sorted函数,该函数根据给定参数排序,可以按照版本号大小倒叙排列,代码如下:sorted([1.9.1,1.24.2,1.6.3],reverse=True) 结果为:[1.24.2,1.9.1,1.6.3]