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