def alphanumeric_key(s):
 k = [(int(c) if c.isdigit() else c) for c in re.split('([0-9]+)', s)]
 return k

def alphanumeric_key ( s ) : k = [ ( int ( c ) if c . isdigit ( ) else c ) for c in re . split ( '([0-9]+)' , s ) ] return k
convert string to list of strings and ints that gives intuitive sorting .