Слави обнови решението на 11.03.2015 02:06 (преди над 9 години)
+def interpret_western_sign(day, month):
+ sign = {'aries': (21, 3, 20, 4),
+ 'taurus': (21, 4, 20, 5),
+ 'gemini': (21, 5, 20, 6),
+ 'cancer': (21, 6, 22, 7),
+ 'leo': (23, 7, 22, 8),
+ 'virgo': (23, 8, 22, 9),
+ 'libra': (23, 9, 22, 10),
+ 'scorpio': (23, 10, 21, 11),
+ 'sagittarius': (22, 11, 21, 12),
+ 'capricorn': (22, 12, 20, 1),
+ 'aquarius': (21, 1, 19, 2),
+ 'pisces': (19, 2, 20, 3)}
+ for sign_name in sign.items():
+ if((sign_name[1][1] == month and sign_name[1][0] <= day) or
+ sign_name[1][3] == month and sign_name[1][2] >= day):
+ return sign_name[0]
+
+
+def interpret_chinese_sign(year):
+ sign = ['monkey', 'rooster', 'dog', 'pig', 'rat', 'ox', 'tiger', 'rabbit', 'dragon', 'snake', 'horse', 'sheep']
+ return sign[year % 12]
+
+
+def interpret_both_signs(day, month, year):
+ return (interpret_western_sign(day, month), interpret_chinese_sign(year))