Емил обнови решението на 05.03.2015 15:57 (преди над 9 години)
+western_sign_dict = {1: [21, "capricorn", "aquarius"],
+ 2: [19, "aquarius", "pisces"],
+ 3: [21, "pisces", "aries"],
+ 4: [21, "aries", "taurus"],
+ 5: [21, "taurus", "gemini"],
+ 6: [21, "gemini", "cancer"],
+ 7: [23, "cancer", "leo"],
+ 8: [23, "leo", "virgo"],
+ 9: [23, "virgo", "libra"],
+ 10: [23, "libra", "scorpio"],
+ 11: [22, "scorpio", "sagittarius"],
+ 12: [22, "sagittarius", "capricorn"]}
+
+chinese_sign_dict = {4: "rat",
+ 5: "ox",
+ 6: "tiger",
+ 7: "rabbit",
+ 8: "dragon",
+ 9: "snake",
+ 10: "horse",
+ 11: "sheep",
+ 0: "monkey",
+ 1: "rooster",
+ 2: "dog",
+ 3: "pig"}
+
+
+def interpret_western_sign(day, month):
+ if day < western_sign_dict[month][0]:
+ return western_sign_dict[month][1]
+ else:
+ return western_sign_dict[month][2]
+
+
+def interpret_chinese_sign(year):
+ return chinese_sign_dict[year % 12]
+
+
+def interpret_both_signs(day, month, year):
+ western_sign = interpret_western_sign(day, month)
+ chinese_sign = interpret_chinese_sign(year)
+ return (western_sign, chinese_sign)