Спасимир обнови решението на 09.03.2015 22:46 (преди над 9 години)
+def interpret_western_sign(day, month):
+ if (21 <= day <= 31 and month == 3) or (1 <= day <= 20 and month == 4):
+ return 'aries'
+ elif (21 <= day <= 30 and month == 4) or (1 <= day <= 20 and month == 5):
+ return 'taurus'
+ elif (21 <= day <= 31 and month == 5) or (1 <= day <= 20 and month == 6):
+ return 'gemini'
+ elif (21 <= day <= 30 and month == 6) or (1 <= day <= 22 and month == 7):
+ return 'cancer'
+ elif (23 <= day <= 31 and month == 7) or (1 <= day <= 22 and month == 8):
+ return 'leo'
+ elif (23 <= day <= 31 and month == 8) or (1 <= day <= 22 and month == 9):
+ return 'virgo'
+ elif (23 <= day <= 30 and month == 9) or (1 <= day <= 22 and month == 10):
+ return 'libra'
+ elif (23 <= day <= 31 and month == 10) or (1 <= day <= 21 and month == 11):
+ return 'scorpio'
+ elif (22 <= day <= 30 and month == 11) or (1 <= day <= 21 and month == 12):
+ return 'sagittarius'
+ elif (22 <= day <= 31 and month == 12) or (1 <= day <= 20 and month == 1):
+ return 'capricorn'
+ elif (21 <= day <= 31 and month == 1) or (1 <= day <= 18 and month == 2):
+ return 'aquarius'
+ elif (19 <= day <= 29 and month == 2) or (1 <= day <= 20 and month == 3):
+ return 'pisces'
+
+
+def interpret_chinese_sign(year):
+ chinese_sign = {0: 'monkey', 1: 'rooster', 2: 'dog', 3: 'pig', 4: 'rat', 5: 'ox',
+ 6: 'tiger', 7: 'rabbit', 8: 'dragon', 9: 'snake',
+ 10: 'horse', 11: 'sheep'}
+ return chinese_sign[year % 12]
+
+
+def interpret_both_signs(day, month, year):
+ return interpret_western_sign(day, month), interpret_chinese_sign(year)