Use python to sort the list ['1.9.1', '1.24.2', '1.6.3'], and note that the content in the list is the version number, which needs to be arranged in reverse order according to the size of the version number. ...

You can use the built-in sorted function in Python. This function sorts according to the given parameters and can be arranged in reverse order according to the version number. The code is as follows: sorted([1.9.1,1.24.2,1.6.3],reverse=True) The result is: [1.24.2, 1.9.1, 1.6.3]

Guess you like

Origin blog.csdn.net/weixin_35748962/article/details/129613732