Skip to content

Instantly share code, notes, and snippets.

@Storager
Created July 21, 2019 19:31
Show Gist options
  • Select an option

  • Save Storager/5b0d26f01a7aee7f43311e7e3b958ee3 to your computer and use it in GitHub Desktop.

Select an option

Save Storager/5b0d26f01a7aee7f43311e7e3b958ee3 to your computer and use it in GitHub Desktop.
my_l is a list of release tags from docker repository
my_l = sorted(my_l, key = lambda x: (int(x.split('-',2)[1].split('.')[0]), int(x.split('-',2)[1].split('.')[1])))
print(my_l)
i=0
cure = ""
while i < 10:
cure = my_l[len(my_l)-1].split('-',2)[1].split('.')[1]
print(cure)
while cure in my_l[len(my_l)-1]:
my_l.pop(len(my_l)-1)
i = i+1
print(my_l)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment