Иван обнови решението на 07.03.2015 12:13 (преди над 9 години)
+SIGNS = ["capricorn", "aquarius", "pisces", "aries", "taurus", "gemini",
+ "cancer", "leo", "virgo", "libra", "scorpio", "sagittarius"]
+
+RANGES = {1: 21, 2: 19, 3: 21, 4: 21, 5: 21, 6: 21, 7: 23, 8: 23, 9: 23,
+ 10: 23, 11: 22, 12: 22}
+
+ANIMALS = ["rat", "ox", "tiger", "rabbit", "dragon", "snake", "horse",
+ "sheep", "monkey", "rooster", "dog", "pig"]
+
+CHINESE_SIGNS = dict(zip(range(1900, 1912), ANIMALS))
+
+
+def interpret_western_sign(day, month):
+ return SIGNS[month % 12 - (day < RANGES[month])]
+
+
+def interpret_chinese_sign(year):
+ for chinese_year in CHINESE_SIGNS.keys():
+ if not (chinese_year - year) % 12:
+ return CHINESE_SIGNS[chinese_year]
+
+
+def interpret_both_signs(day, month, year):
+ return (interpret_western_sign(day, month), interpret_chinese_sign(year))