Skip to content

Instantly share code, notes, and snippets.

@maxhodak
Created April 14, 2010 08:02
Show Gist options
  • Save maxhodak/365573 to your computer and use it in GitHub Desktop.
Save maxhodak/365573 to your computer and use it in GitHub Desktop.
def geography(datum):
if datum in ("CT","DE","ME","MD","MA","NH","NJ","NY","PA","RI","VT"):
return (1, 0, 0, 0, 0)
elif datum in ("AL","AR","GA","KY","LA","MS","NC","SC","TN","VA","WV"):
return (0, 1, 0, 0, 0)
elif datum in ("IL","IN","IA","KS","MI","MN","MO","NE","ND","OH","SD","WI"):
return (0, 0, 1, 0, 0)
elif datum in ("AZ","NM","OK","TX"):
return (0, 0, 0, 1, 0)
elif datum in ("AK","CA","CO","HI","ID","MT","NV","OR","UT","WA","WY"):
return (0, 0, 0, 0, 1)
return (0, 0, 0, 0, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment