Вера обнови решението на 10.03.2015 23:54 (преди над 9 години)
+def interpret_western_sign(day, month):
+ months = {
+ 3: [21, 11, 0],
+ 4: [21, 0, 1],
+ 5: [21, 1, 2],
+ 6: [21, 2, 3],
+ 7: [23, 3, 4],
+ 8: [23, 4, 5],
+ 9: [23, 5, 6],
+ 10: [23, 6, 7],
+ 11: [22, 7, 8],
+ 12: [22, 8, 9],
+ 1: [21, 9, 10],
+ 2: [19, 10, 11]
+ }
+ signs = [
+ 'aries',
+ 'taurus',
+ 'gemini',
+ 'cancer',
+ 'leo',
+ 'virgo',
+ 'libra',
+ 'scorpio',
+ 'sagittarius',
+ 'capricorn',
+ 'aquarius',
+ 'pisces'
+ ]
+ if day < months.get(month)[0]:
+ return signs[months.get(month)[1]]
+ else:
+ return signs[months.get(month)[2]]
+
+
+def interpret_chinese_sign(year):
+ chinese_signs = [
+ 'rat',
+ 'ox',
+ 'tiger',
+ 'rabbit',
+ 'dragon',
+ 'snake',
+ 'horse',
+ 'sheep',
+ 'monkey',
+ 'rooster',
+ 'dog',
+ 'pig'
+ ]
+ return chinese_signs[(year - 1900) % 12]
+
+
+def interpret_both_signs(day, month, year):
+ arg1 = interpret_western_sign(day, month)
+ arg2 = interpret_chinese_sign(year)
+ res = (arg1, arg2)
+ return res