from random import randrange
input = [10, 5, 2, 3, 7, 0, 9, 12]
def quicksort(arr):
if len(arr) < 2:
return arr
else:
rand = randrange(0, len(arr)) # grab a random index
pivot = arr.pop(rand)
less = [i for i in arr if i <= pivot]
greater = [i for i in arr if i > pivot]
return quicksort(less) + [pivot] + quicksort(greater)
print("sorted: ", quicksort(input))
def atoi(text):
return int(text) if text.isdigit() else text
def natural_keys(text):
return [ atoi(c) for c in re.split(r'(\d+)', text) ]
my_list.sort(key=natural_keys)
|jq -r '.ApplicationVersions|sort_by(.DateCreated)|.[]|.VersionLabel'|tail -1