Станислав обнови решението на 05.03.2015 10:52 (преди над 9 години)
+WESTERN_SIGNS = (
+ ('aquarius', 21),
+ ('pisces', 19),
+ ('aries', 21),
+ ('taurus', 21),
+ ('gemini', 21),
+ ('cancer', 21),
+ ('leo', 23),
+ ('virgo', 23),
+ ('libra', 23),
+ ('scorpio', 23),
+ ('sagittarius', 22),
+ ('capricorn', 22)
+)
+
+CHINESE_SIGNS = (
+ 'monkey',
+ 'rooster',
+ 'dog',
+ 'pig',
+ 'rat',
+ 'ox',
+ 'tiger',
+ 'rabbit',
+ 'dragon',
+ 'snake',
+ 'horse',
+ 'sheep'
+)
+
+
+def interpret_western_sign(day, month):
+ if day >= WESTERN_SIGNS[month - 1][1]:
+ return WESTERN_SIGNS[month - 1][0]
+ previous_month = month - 1
+ return WESTERN_SIGNS[previous_month - 1][0]
+
+
+def interpret_chinese_sign(year):
+ return CHINESE_SIGNS[year % len(CHINESE_SIGNS)]
+
+
+def interpret_both_signs(day, month, year):
+ return (interpret_western_sign(day, month),
+ interpret_chinese_sign(year))