Атанас обнови решението на 11.03.2015 01:17 (преди над 9 години)
+zodiac = {
+ 1: [20, 'capricorn', 'aquarius'],
+ 2: [19, 'aquarius', 'pisces'],
+ 3: [20, 'pisces', 'aries'],
+ 4: [20, 'aries', 'taurus'],
+ 5: [20, 'taurus', 'gemini'],
+ 6: [20, 'gemini', 'cancer'],
+ 7: [22, 'cancer', 'leo'],
+ 8: [22, 'leo', 'virgo'],
+ 9: [22, 'virgo', 'libra'],
+ 10: [22, 'libra', 'scorpio'],
+ 11: [21, 'scorpio', 'sagittarius'],
+ 12: [21, 'sagittarius', 'capricorn']
+}
+
+
+zodiac_chinese = ['rat', 'ox', 'tiger', 'rabbit', 'dragon', 'snake',
+ 'horse', 'sheep', 'monkey', 'rooster', 'dog', 'pig']
+
+
+def interpret_western_sign(day, month):
+ if day <= zodiac[month][0]:
+ return zodiac[month][1]
+ else:
+ return zodiac[month][2]
+
+
+def interpret_chinese_sign(year):
+ return zodiac_chinese[(8 + year % 12) % 12]
+
+
+def interpret_both_signs(day, month, year):
+ return (interpret_western_sign(day, month), interpret_chinese_sign(year))