Екатерина обнови решението на 08.03.2015 17:50 (преди над 9 години)
+def interpret_western_sign(day, month):
+ signs = [('capricorn', 20), ('aquarius', 18), ('pisces', 20), ('aries', 20),
+ ('taurus', 20), ('gemini', 20), ('cancer', 22), ('leo', 22),
+ ('virgo', 22), ('libra', 22), ('scorpio', 21), ('sagittarius', 21)]
+
+ if signs[(month - 1) % 12][1] >= day:
+ return signs[(month - 1) % 12][0]
+ return signs[month % 12][0]
+
+
+def interpret_chinese_sign(year):
+ signs = ['rat', 'ox', 'tiger', 'rabbit', 'dragon', 'snake', 'horse',
+ 'sheep', 'monkey', 'rooster', 'dog', 'pig']
+
+ for i in range(len(signs)):
+ if (year - 1900 - i) % 12 == 0:
+ return signs[i]
+
+
+def interpret_both_signs(day, month, year):
+ return (interpret_western_sign(day, month), interpret_chinese_sign(year))