Skip to content

Instantly share code, notes, and snippets.

@elephantum
Created August 30, 2010 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elephantum/557195 to your computer and use it in GitHub Desktop.
Save elephantum/557195 to your computer and use it in GitHub Desktop.
a = '1.2.3'
b = '1.3.4'
def cmp(a, b):
for (i,j) in zip(a.split('.'), b.split('.')):
if int(i) < int(j):
return False
elif int(i) > int(j):
return True
return True
if cmp(a,b):
print a, 'is bigger'
else:
print b, 'is bigger'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment