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