Created
January 11, 2016 11:01
-
-
Save TApplencourt/da9a3d2b34798efe0bf6 to your computer and use it in GitHub Desktop.
For gamess programm, the order of primitive for the AO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def same_character(item1): | |
return item1==item1[0]* len(item1) | |
def compare_gamess_style(item1, item2): | |
if len(item1) < len(item2): | |
return -1 | |
elif len(item1) > len(item2): | |
return 1 | |
elif same_character(item1) and same_character(item2): | |
if item1 < item2: | |
return -1 | |
else: | |
return 1 | |
elif same_character(item1) and not same_character(item2): | |
return -1 | |
elif not same_character(item1) and same_character(item2): | |
return 1 | |
else: | |
return compare_gamess_style(item1[:-1],item2[:-1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment