Skip to content

Instantly share code, notes, and snippets.

@axiak
Created September 14, 2012 19:27
Show Gist options
  • Save axiak/3724152 to your computer and use it in GitHub Desktop.
Save axiak/3724152 to your computer and use it in GitHub Desktop.
SEGMENT_TABLE = {
1: (39.5, 40),
2: (40, 50),
}
def get_segment(position):
for key, (lower, upper) in SEGMENT_TABLE.items():
if lower <= position < upper:
return key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment