Елена обнови решението на 05.03.2015 18:57 (преди над 9 години)
+def interpret_western_sign(day, month):
+ zodiac_boundaries = [
+ -1, 21, 19, 21, 21,
+ 21, 21, 23, 23, 23,
+ 23, 22, 22, 21,
+ ]
+ zodiac_names = [
+ "", "capricorn", "aquarius", "pisces", "aries",
+ "taurus", "gemini", "cancer", "leo", "virgo",
+ "libra", "scorpio", "sagittarius", "capricorn",
+ ]
+ if day < zodiac_boundaries[month]:
+ return zodiac_names[month]
+ return zodiac_names[month + 1]
+
+
+def interpret_chinese_sign(year):
+ chinese_signs_names = [
+ "monkey", "rooster", "dog", "pig", "rat", "ox",
+ "tiger", "rabbit", "dragon", "snake", "horse", "sheep",
+ ]
+ return chinese_signs_names[year % 12]
+
+
+def interpret_both_signs(day, month, year):
+ return (interpret_western_sign(day, month), interpret_chinese_sign(year))