Любослав обнови решението на 10.03.2015 01:11 (преди над 9 години)
+def interpret_chinese_sign(year):
+ signs = ["rat", "ox", "tiger", "rabbit", "dragon", "snake", "horse",
+ "sheep", "monkey", "rooster", "dog", "pig"]
+ return signs[(year - 1900) % 12]
+
+
+def interpret_western_sign(day, month):
+ signs = [(1222, "capricorn"), (1122, "sagittarius"), (1023, "scorpio"),
+ (923, "libra"), (823, "virgo"), (723, "leo"),
+ (621, "cancer"), (521, "gemini"), (421, "taurus"),
+ (321, "aries"), (219, "pisces"), (121, "aquarius")]
+
+ result = "capricorn"
+ key = month*100 + day
+
+ for sign in signs:
+ if key >= sign[0]:
+ result = sign[1]
+ break
+
+ return result
+
+
+def interpret_both_signs(day, month, year):
+ return (interpret_western_sign(day, month), interpret_chinese_sign(year))
+