Решение на Астрологични забави от Йордан Русев

Обратно към всички решения

Към профила на Йордан Русев

Резултати

  • 10 точки от тестове
  • 1 отнета точка
  • 9 точки общо
  • 6 успешни тест(а)
  • 0 неуспешни тест(а)

Код

WESTERN_SIGNS = ("aries", "taurus", "gemini", "cancer",
"leo", "virgo", "libra", "scorpio",
"sagittarius", "capricorn", "aquarius", "pisces")
CHINESE_SIGNS = ("rat", "ox", "tiger", "rabbit", "dragon", "snake",
"horse", "sheep", "monkey", "rooster", "dog", "pig")
def interpret_western_sign(day, month):
if (month == 3 and day >= 21 or
month == 4 and day <= 20):
return WESTERN_SIGNS[0]
elif (month == 4 and day >= 21 or
month == 5 and day <= 20):
return WESTERN_SIGNS[1]
elif (month == 5 and day >= 21 or
month == 6 and day <= 20):
return WESTERN_SIGNS[2]
elif (month == 6 and day >= 21 or
month == 7 and day <= 22):
return WESTERN_SIGNS[3]
elif (month == 7 and day >= 23 or
month == 8 and day <= 22):
return WESTERN_SIGNS[4]
elif (month == 8 and day >= 23 or
month == 9 and day <= 22):
return WESTERN_SIGNS[5]
elif (month == 9 and day >= 23 or
month == 10 and day <= 22):
return WESTERN_SIGNS[6]
elif (month == 10 and day >= 23 or
month == 11 and day <= 21):
return WESTERN_SIGNS[7]
elif (month == 11 and day >= 22 or
month == 12 and day <= 21):
return WESTERN_SIGNS[8]
elif (month == 12 and day >= 22 or
month == 1 and day <= 20):
return WESTERN_SIGNS[9]
elif (month == 1 and day >= 21 or
month == 2 and day <= 18):
return WESTERN_SIGNS[10]
else:
return WESTERN_SIGNS[11]
def interpret_chinese_sign(year):
return CHINESE_SIGNS[abs((year - 1900) % 12)]
def interpret_both_signs(day, month, year):
return (interpret_western_sign(day, month),
interpret_chinese_sign(year))

Лог от изпълнението

......
----------------------------------------------------------------------
Ran 6 tests in 0.007s

OK

История (4 версии и 3 коментара)

Йордан обнови решението на 11.03.2015 13:58 (преди над 9 години)

+WESTERN_SIGNS = ("aries", "taurus", "gemini", "cancer",
+ "leo", "virgo", "libra", "scorpio",
+ "sagittarius", "capricorn", "aquarius", "pisces")
+
+CHINESE_SIGNS = ("rat", "ox", "tiger", "rabbit", "dragon", "snake",
+ "horse", "sheep", "monkey", "rooster", "dog", "pig")
+
+
+def interpret_western_sign(day, month):
+ if month == 3:
+ if day <= 20:
+ return WESTERN_SIGNS[11]
+ else:
+ return WESTERN_SIGNS[0]
+ elif month == 4:
+ if day <= 20:
+ return WESTERN_SIGNS[0]
+ else:
+ return WESTERN_SIGNS[1]
+ elif month == 5:
+ if day <= 20:
+ return WESTERN_SIGNS[1]
+ else:
+ return WESTERN_SIGNS[2]
+ elif month == 6:
+ if day <= 20:
+ return WESTERN_SIGNS[2]
+ else:
+ return WESTERN_SIGNS[3]
+ elif month == 7:
+ if day <= 22:
+ return WESTERN_SIGNS[3]
+ else:
+ return WESTERN_SIGNS[4]
+ elif month == 8:
+ if day <= 22:
+ return WESTERN_SIGNS[4]
+ else:
+ return WESTERN_SIGNS[5]
+ elif month == 9:
+ if day <= 22:
+ return WESTERN_SIGNS[5]
+ else:
+ return WESTERN_SIGNS[6]
+ elif month == 10:
+ if day <= 22:
+ return WESTERN_SIGNS[6]
+ else:
+ return WESTERN_SIGNS[7]
+ elif month == 11:
+ if day <= 21:
+ return WESTERN_SIGNS[7]
+ else:
+ return WESTERN_SIGNS[8]
+ elif month == 12:
+ if day <= 21:
+ return WESTERN_SIGNS[8]
+ else:
+ return WESTERN_SIGNS[9]
+ elif month == 1:
+ if day <= 20:
+ return WESTERN_SIGNS[9]
+ else:
+ return WESTERN_SIGNS[10]
+ else:
+ if day <= 18:
+ return WESTERN_SIGNS[10]
+ else:
+ return WESTERN_SIGNS[11]
+
+
+def interpret_chinese_sign(year):
+ return CHINESE_SIGNS[abs((year - 1900) % 12)]
+
+def interpret_both_signs(day, month, year):
+ tmp = (interpret_western_sign(day, month),
+ interpret_chinese_sign(year))
+ return tmp

Йордан обнови решението на 11.03.2015 14:52 (преди над 9 години)

WESTERN_SIGNS = ("aries", "taurus", "gemini", "cancer",
"leo", "virgo", "libra", "scorpio",
"sagittarius", "capricorn", "aquarius", "pisces")
CHINESE_SIGNS = ("rat", "ox", "tiger", "rabbit", "dragon", "snake",
"horse", "sheep", "monkey", "rooster", "dog", "pig")
def interpret_western_sign(day, month):
if month == 3:
if day <= 20:
return WESTERN_SIGNS[11]
else:
return WESTERN_SIGNS[0]
elif month == 4:
if day <= 20:
return WESTERN_SIGNS[0]
else:
return WESTERN_SIGNS[1]
elif month == 5:
if day <= 20:
return WESTERN_SIGNS[1]
else:
return WESTERN_SIGNS[2]
elif month == 6:
if day <= 20:
return WESTERN_SIGNS[2]
else:
return WESTERN_SIGNS[3]
elif month == 7:
if day <= 22:
return WESTERN_SIGNS[3]
else:
return WESTERN_SIGNS[4]
elif month == 8:
if day <= 22:
return WESTERN_SIGNS[4]
else:
return WESTERN_SIGNS[5]
elif month == 9:
if day <= 22:
return WESTERN_SIGNS[5]
else:
return WESTERN_SIGNS[6]
elif month == 10:
if day <= 22:
return WESTERN_SIGNS[6]
else:
return WESTERN_SIGNS[7]
elif month == 11:
if day <= 21:
return WESTERN_SIGNS[7]
else:
return WESTERN_SIGNS[8]
elif month == 12:
if day <= 21:
return WESTERN_SIGNS[8]
else:
return WESTERN_SIGNS[9]
elif month == 1:
if day <= 20:
return WESTERN_SIGNS[9]
else:
return WESTERN_SIGNS[10]
else:
if day <= 18:
return WESTERN_SIGNS[10]
else:
return WESTERN_SIGNS[11]
def interpret_chinese_sign(year):
return CHINESE_SIGNS[abs((year - 1900) % 12)]
+
def interpret_both_signs(day, month, year):
tmp = (interpret_western_sign(day, month),
- interpret_chinese_sign(year))
- return tmp
+ interpret_chinese_sign(year))
+ return tmp

Йордан обнови решението на 11.03.2015 16:08 (преди над 9 години)

WESTERN_SIGNS = ("aries", "taurus", "gemini", "cancer",
"leo", "virgo", "libra", "scorpio",
"sagittarius", "capricorn", "aquarius", "pisces")
CHINESE_SIGNS = ("rat", "ox", "tiger", "rabbit", "dragon", "snake",
"horse", "sheep", "monkey", "rooster", "dog", "pig")
def interpret_western_sign(day, month):
if month == 3:
if day <= 20:
return WESTERN_SIGNS[11]
else:
return WESTERN_SIGNS[0]
elif month == 4:
if day <= 20:
return WESTERN_SIGNS[0]
else:
return WESTERN_SIGNS[1]
elif month == 5:
if day <= 20:
return WESTERN_SIGNS[1]
else:
return WESTERN_SIGNS[2]
elif month == 6:
if day <= 20:
return WESTERN_SIGNS[2]
else:
return WESTERN_SIGNS[3]
elif month == 7:
if day <= 22:
return WESTERN_SIGNS[3]
else:
return WESTERN_SIGNS[4]
elif month == 8:
if day <= 22:
return WESTERN_SIGNS[4]
else:
return WESTERN_SIGNS[5]
elif month == 9:
if day <= 22:
return WESTERN_SIGNS[5]
else:
return WESTERN_SIGNS[6]
elif month == 10:
if day <= 22:
return WESTERN_SIGNS[6]
else:
return WESTERN_SIGNS[7]
elif month == 11:
if day <= 21:
return WESTERN_SIGNS[7]
else:
return WESTERN_SIGNS[8]
elif month == 12:
if day <= 21:
return WESTERN_SIGNS[8]
else:
return WESTERN_SIGNS[9]
elif month == 1:
if day <= 20:
return WESTERN_SIGNS[9]
else:
return WESTERN_SIGNS[10]
else:
if day <= 18:
return WESTERN_SIGNS[10]
else:
return WESTERN_SIGNS[11]
def interpret_chinese_sign(year):
return CHINESE_SIGNS[abs((year - 1900) % 12)]
def interpret_both_signs(day, month, year):
- tmp = (interpret_western_sign(day, month),
- interpret_chinese_sign(year))
+ return (interpret_western_sign(day, month),
- return tmp
+ interpret_chinese_sign(year))
+

Йордан обнови решението на 11.03.2015 16:59 (преди над 9 години)

WESTERN_SIGNS = ("aries", "taurus", "gemini", "cancer",
"leo", "virgo", "libra", "scorpio",
"sagittarius", "capricorn", "aquarius", "pisces")
CHINESE_SIGNS = ("rat", "ox", "tiger", "rabbit", "dragon", "snake",
"horse", "sheep", "monkey", "rooster", "dog", "pig")
def interpret_western_sign(day, month):
- if month == 3:
- if day <= 20:
- return WESTERN_SIGNS[11]
- else:
- return WESTERN_SIGNS[0]
- elif month == 4:
- if day <= 20:
- return WESTERN_SIGNS[0]
- else:
- return WESTERN_SIGNS[1]
- elif month == 5:
- if day <= 20:
- return WESTERN_SIGNS[1]
- else:
- return WESTERN_SIGNS[2]
- elif month == 6:
- if day <= 20:
- return WESTERN_SIGNS[2]
- else:
- return WESTERN_SIGNS[3]
- elif month == 7:
- if day <= 22:
- return WESTERN_SIGNS[3]
- else:
- return WESTERN_SIGNS[4]
- elif month == 8:
- if day <= 22:
- return WESTERN_SIGNS[4]
- else:
- return WESTERN_SIGNS[5]
- elif month == 9:
- if day <= 22:
- return WESTERN_SIGNS[5]
- else:
- return WESTERN_SIGNS[6]
- elif month == 10:
- if day <= 22:
- return WESTERN_SIGNS[6]
- else:
- return WESTERN_SIGNS[7]
- elif month == 11:
- if day <= 21:
- return WESTERN_SIGNS[7]
- else:
- return WESTERN_SIGNS[8]
- elif month == 12:
- if day <= 21:
- return WESTERN_SIGNS[8]
- else:
- return WESTERN_SIGNS[9]
- elif month == 1:
- if day <= 20:
- return WESTERN_SIGNS[9]
- else:
- return WESTERN_SIGNS[10]
+ if (month == 3 and day >= 21 or
+ month == 4 and day <= 20):
+ return WESTERN_SIGNS[0]
+ elif (month == 4 and day >= 21 or
+ month == 5 and day <= 20):
+ return WESTERN_SIGNS[1]
+ elif (month == 5 and day >= 21 or
+ month == 6 and day <= 20):
+ return WESTERN_SIGNS[2]
+ elif (month == 6 and day >= 21 or
+ month == 7 and day <= 22):
+ return WESTERN_SIGNS[3]
+ elif (month == 7 and day >= 23 or
+ month == 8 and day <= 22):
+ return WESTERN_SIGNS[4]
+ elif (month == 8 and day >= 23 or
+ month == 9 and day <= 22):
+ return WESTERN_SIGNS[5]
+ elif (month == 9 and day >= 23 or
+ month == 10 and day <= 22):
+ return WESTERN_SIGNS[6]
+ elif (month == 10 and day >= 23 or
+ month == 11 and day <= 21):
+ return WESTERN_SIGNS[7]
+ elif (month == 11 and day >= 22 or
+ month == 12 and day <= 21):
+ return WESTERN_SIGNS[8]
+ elif (month == 12 and day >= 22 or
+ month == 1 and day <= 20):
+ return WESTERN_SIGNS[9]
+ elif (month == 1 and day >= 21 or
+ month == 2 and day <= 18):
+ return WESTERN_SIGNS[10]
else:
- if day <= 18:
- return WESTERN_SIGNS[10]
- else:
- return WESTERN_SIGNS[11]
+ return WESTERN_SIGNS[11]
def interpret_chinese_sign(year):
return CHINESE_SIGNS[abs((year - 1900) % 12)]
def interpret_both_signs(day, month, year):
return (interpret_western_sign(day, month),
interpret_chinese_sign(year))
-