Created
January 28, 2019 03:12
-
-
Save RRRoger/a0c1588fdd7a1b520d1600ab4cc5e18c to your computer and use it in GitHub Desktop.
get the constellation by your input
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
# -*- encoding: utf-8 -*- | |
def _get_stars(date): | |
res = '' | |
star_key = { | |
1: ('摩羯座', '水瓶座'), | |
2: ('水瓶座', '双鱼座'), | |
3: ('双鱼座', '白羊座'), | |
4: ('白羊座', '金牛座'), | |
5: ('金牛座', '双子座'), | |
6: ('双子座', '巨蟹座'), | |
7: ('巨蟹座', '狮子座'), | |
8: ('狮子座', '处女座'), | |
9: ('处女座', '天秤座'), | |
10: ('天秤座', '天蝎座'), | |
11: ('天蝎座', '射手座'), | |
12: ('射手座', '摩羯座'), | |
} | |
month = int(date[:2]) | |
day = int(date[3:]) | |
if day < 20: | |
res = star_key[month][0] | |
else: | |
res = star_key[month][1] | |
return res | |
print _get_stars('03-07') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment