-
-
Save PyDann/182849dddc763ad46ccc to your computer and use it in GitHub Desktop.
Compass
This file contains 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
if x >= 340 or x <= 20: | |
return 'N' | |
elif x > 20 and x < 70: | |
return 'NE' | |
elif x >= 70 and x <= 110: | |
return 'E' | |
elif x > 110 and x < 160: | |
return 'SE' | |
elif x >= 160 and x <= 200: | |
return 'S' | |
elif x < 250 and x > 200: | |
return 'SW' | |
elif x >= 250 and x <= 290: | |
return 'W' | |
else: | |
return 'NW' |
cclauss
commented
Mar 20, 2014
Your second solution should have been more obvious to me.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment