Цветан обнови решението на 06.03.2015 22:28 (преди над 9 години)
+chinese_signs = [
+ 'monkey', 'rooster', 'dog',
+ 'pig', 'rat', 'ox',
+ 'tiger', 'rabbit', 'dragon',
+ 'snake', 'horse', 'sheep'
+ ]
+
+western_signs = [
+ ['aquarius', 'capricorn', 21], ['pisces', 'aquarius', 19],
+ ['aries', 'pisces', 21], ['taurus', 'aries', 21],
+ ['gemini', 'taurus', 21], ['cancer', 'gemini', 21],
+ ['leo', 'cancer', 23], ['virgo', 'leo', 23],
+ ['libra', 'virgo', 23], ['scorpio', 'libra', 23],
+ ['sagittarius', 'scorpio', 22], ['capricorn', 'sagittarius', 22]
+ ]
+
+
+def interpret_chinese_sign(year):
+ return chinese_signs[year % 12]
+
+
+def interpret_western_sign(day, month):
+ month_signs = western_signs[month - 1]
+ return month_signs[0] if day >= month_signs[2] else month_signs[1]
+
+
+def interpret_both_signs(day, month, year):
+ western_sign = interpret_western_sign(day, month)
+ chinese_sign = interpret_chinese_sign(year)
+
+ return (western_sign, chinese_sign)