Елица обнови решението на 11.03.2015 16:03 (преди над 9 години)
+def interpret_western_sign(day, month):
+ zodiac = [
+ {'21': ['capricorn', 'aquarius']},
+ {'19': ['aquarius', 'pisces']},
+ {'21': ['pisces', 'aries']},
+ {'21': ['aries', 'taurus']},
+ {'21': ['taurus', 'gemini']},
+ {'21': ['gemini', 'cancer']},
+ {'23': ['cancer', 'leo']},
+ {'23': ['leo', 'virgo']},
+ {'23': ['virgo', 'libra']},
+ {'23': ['libra', 'scorpio']},
+ {'22': ['scorpio', 'sagittarius']},
+ {'22': ['sagittarius', 'capricorn']}
+ ]
+ if int(list(zodiac[month - 1].keys())[0]) / day <= 1:
+ return list(zodiac[month - 1].values())[0][1]
+ else:
+ return list(zodiac[month - 1].values())[0][0]
+
+
+def interpret_chinese_sign(year):
+ return [
+ 'rat', 'ox', 'tiger', 'rabbit', 'dragon', 'snake', 'horse',
+ 'sheep', 'monkey', 'rooster', 'dog', 'pig'][abs((year - 1900) % 12)]
+
+
+def interpret_both_signs(day, month, year):
+ return (interpret_western_sign(day, month), interpret_chinese_sign(year))