Димитрина обнови решението на 09.03.2015 23:58 (преди над 9 години)
+# task_1
+def interpret_western_sign (day, month):
+ months = {1:[21, "capricorn", "aquarius"], 2:[19, "aquarius", "pisces"],
+ 3:[21, "pisces", "aries"], 4:[21, "aries", "taurus"], 5:[21,"taurus", "gemini"],
+ 6:[21, "gemini", "cancer"], 7:[23, "cancer", "leo"], 8:[23, "leo", "virgo"],
+ 9:[23, "virgo", "libra"], 10:[23, "libra", "scorpio"], 11: [22, "scorpio", "sagittarius"],
+ 12:[22, "sagittarius", "capricorn"]}
+ month_info = months.get(month)
+ #print (month_info)
+ if day < month_info[0]:
+ #print (month_info[1])
+ return month_info[1]
+ else:
+ #print (month_info[2])
+ return month_info[2]
+
+# task_2
+def interpret_chinese_sign(year):
+ months = 12
+ residue = year % months
+ years_dic = {1:"rooster", 2:"dog", 3:"pig", 4:"rat", 5:"ox", 6:"tiger",
+ 7:"rabbit", 8:"dragon", 9:"snake", 10:"horse", 11:"sheep", 0:"monkey"} #important that 12%12=0 for december
+ return years_dic.get(residue)
+
+# task_3
+def interpret_both_signs(day, month, year):
+ return (interpret_western_sign (day, month), interpret_chinese_sign(year))
+