Йордан обнови решението на 11.03.2015 13:58 (преди над 9 години)
+WESTERN_SIGNS = ("aries", "taurus", "gemini", "cancer",
+ "leo", "virgo", "libra", "scorpio",
+ "sagittarius", "capricorn", "aquarius", "pisces")
+
+CHINESE_SIGNS = ("rat", "ox", "tiger", "rabbit", "dragon", "snake",
+ "horse", "sheep", "monkey", "rooster", "dog", "pig")
+
+
+def interpret_western_sign(day, month):
+ if month == 3:
+ if day <= 20:
+ return WESTERN_SIGNS[11]
+ else:
+ return WESTERN_SIGNS[0]
+ elif month == 4:
+ if day <= 20:
+ return WESTERN_SIGNS[0]
+ else:
+ return WESTERN_SIGNS[1]
+ elif month == 5:
+ if day <= 20:
+ return WESTERN_SIGNS[1]
+ else:
+ return WESTERN_SIGNS[2]
+ elif month == 6:
+ if day <= 20:
+ return WESTERN_SIGNS[2]
+ else:
+ return WESTERN_SIGNS[3]
+ elif month == 7:
+ if day <= 22:
+ return WESTERN_SIGNS[3]
+ else:
+ return WESTERN_SIGNS[4]
+ elif month == 8:
+ if day <= 22:
+ return WESTERN_SIGNS[4]
+ else:
+ return WESTERN_SIGNS[5]
+ elif month == 9:
+ if day <= 22:
+ return WESTERN_SIGNS[5]
+ else:
+ return WESTERN_SIGNS[6]
+ elif month == 10:
+ if day <= 22:
+ return WESTERN_SIGNS[6]
+ else:
+ return WESTERN_SIGNS[7]
+ elif month == 11:
+ if day <= 21:
+ return WESTERN_SIGNS[7]
+ else:
+ return WESTERN_SIGNS[8]
+ elif month == 12:
+ if day <= 21:
+ return WESTERN_SIGNS[8]
+ else:
+ return WESTERN_SIGNS[9]
+ elif month == 1:
+ if day <= 20:
+ return WESTERN_SIGNS[9]
+ else:
+ return WESTERN_SIGNS[10]
+ else:
+ if day <= 18:
+ return WESTERN_SIGNS[10]
+ else:
+ return WESTERN_SIGNS[11]
+
+
+def interpret_chinese_sign(year):
+ return CHINESE_SIGNS[abs((year - 1900) % 12)]
+
+def interpret_both_signs(day, month, year):
+ tmp = (interpret_western_sign(day, month),
+ interpret_chinese_sign(year))
+ return tmp