python isdigi code example
Example 1: isdigit
Non-zero integer ( x > 0 ) Argument is a numeric character.
Zero (0) Argument is not a numeric character.
Example 2: python sort isdigit
>>> my_list= ['image101.jpg', 'image2.jpg', 'image1.jpg']
>>> my_list.sort(key=lambda x: int(''.join(filter(str.isdigit, x))))
>>> my_list
['image1.jpg', 'image2.jpg', 'image101.jpg']