Цвета обнови решението на 08.03.2015 19:06 (преди над 9 години)
+def interpret_western_sign(day, month):
+ signs = ["capricorn", "aquarius", "pisces", "aries",
+ "taurus", "gemini", "cancer", "leo", "virgo",
+ "libra", "scorpio", "sagittarius", "capricorn"]
+
+ sign_change = [22, 21, 20, 21, 21, 22, 22, 23, 23, 24, 24, 23, 22]
+
+ if day >= sign_change[month]:
+ return signs[month]
+ return signs[month - 1]
+
+
+def interpret_chinese_sign(year):
+ zodiac = {
+ (1900 % 12): 'rat',
+ (1901 % 12): 'ox',
+ (1902 % 12): 'tiger',
+ (1903 % 12): 'rabbit',
+ (1904 % 12): 'dragon',
+ (1905 % 12): 'snake',
+ (1906 % 12): 'horse',
+ (1907 % 12): 'sheep',
+ (1908 % 12): 'monkey',
+ (1909 % 12): 'rooster',
+ (1910 % 12): 'dog',
+ (1911 % 12): 'pig',
+ }
+ return zodiac[year % 12]
+
+
+def interpret_both_signs(day, month, year):
+ return (interpret_western_sign(day, month), interpret_chinese_sign(year))