Решение на Хороскоп от Фатих Хюсеинов

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

Към профила на Фатих Хюсеинов

Резултати

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

Код

def what_is_my_sign(day, month):
sign=("Овен", "Телец", "Близнаци", "Рак",
"Лъв", "Дева", "Везни", "Скорпион",
"Стрелец", "Козирог", "Водолей", "Риби")
date = month + day/100
if date >= 3.21 and date <= 4.20:
return sign[0]
elif date >= 4.21 and date <= 5.20:
return sign[1]
elif date >= 5.21 and date <= 6.20:
return sign[2]
elif date >= 6.20 and date <= 7.21:
return sign[3]
elif date >= 7.22 and date <= 8.22:
return sign[4]
elif date >= 8.23 and date <= 9.22:
return sign[5]
elif date >= 9.23 and date <= 10.22:
return sign[6]
elif date >= 10.23 and date <= 11.21:
return sign[7]
elif date >= 11.22 and date <= 12.21:
return sign[8]
elif date >= 12.22 or date <= 1.19:
return sign[9]
elif date >= 1.20 and date <= 2.18:
return sign[10]
elif date >= 2.19 and date <= 3.20:
return sign[11]

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

...............
----------------------------------------------------------------------
Ran 15 tests in 0.001s

OK

История (2 версии и 1 коментар)

Фатих обнови решението на 28.02.2013 18:00 (преди над 11 години)

+def what_is_my_sign(day, month):
+ if (day>=21 and month==3) or (day<=20 and month==4):
+ return "Овен"
+ elif (day>=21 and month==4) or (day<=20 and month==5):
+ return "Телец"
+ elif (day>=21 and month==5) or (day<=20 and month==6):
+ return "Близнаци"
+ elif (day>=21 and month==6) or (day<=21 and month==7):
+ return "Рак"
+ elif (day>=22 and month==7) or (day<=22 and month==8):
+ return "Лъв"
+ elif (day>=23 and month==8) or (day<=22 and month==9):
+ return "Дева"
+ elif (day>=23 and month==9) or (day<=22 and month==10):
+ return "Везни"
+ elif (day>=23 and month==10) or (day<=21 and month==11):
+ return "Скорпион"
+ elif (day>=22 and month==11) or (day<=21 and month==12):
+ return "Стрелец"
+ elif (day>=22 and month==12) or (day<=19 and month==1):
+ return "Козирог"
+ elif (day>=20 and month==1) or (day<=18 and month==2):
+ return "Водолей"
+ elif (day>=19 and month==2) or (day<=20 and month==3):
+ return "Риби"
+

Фатих обнови решението на 28.02.2013 23:29 (преди над 11 години)

def what_is_my_sign(day, month):
- if (day>=21 and month==3) or (day<=20 and month==4):
- return "Овен"
- elif (day>=21 and month==4) or (day<=20 and month==5):
- return "Телец"
- elif (day>=21 and month==5) or (day<=20 and month==6):
- return "Близнаци"
- elif (day>=21 and month==6) or (day<=21 and month==7):
- return "Рак"
- elif (day>=22 and month==7) or (day<=22 and month==8):
- return "Лъв"
- elif (day>=23 and month==8) or (day<=22 and month==9):
- return "Дева"
- elif (day>=23 and month==9) or (day<=22 and month==10):
- return "Везни"
- elif (day>=23 and month==10) or (day<=21 and month==11):
- return "Скорпион"
- elif (day>=22 and month==11) or (day<=21 and month==12):
- return "Стрелец"
- elif (day>=22 and month==12) or (day<=19 and month==1):
- return "Козирог"
- elif (day>=20 and month==1) or (day<=18 and month==2):
- return "Водолей"
- elif (day>=19 and month==2) or (day<=20 and month==3):
- return "Риби"
+ sign=("Овен", "Телец", "Близнаци", "Рак",
+ "Лъв", "Дева", "Везни", "Скорпион",
+ "Стрелец", "Козирог", "Водолей", "Риби")
+ date = month + day/100
+ if date >= 3.21 and date <= 4.20:
+ return sign[0]
+ elif date >= 4.21 and date <= 5.20:
+ return sign[1]
+ elif date >= 5.21 and date <= 6.20:
+ return sign[2]
+ elif date >= 6.20 and date <= 7.21:
+ return sign[3]
+ elif date >= 7.22 and date <= 8.22:
+ return sign[4]
+ elif date >= 8.23 and date <= 9.22:
+ return sign[5]
+ elif date >= 9.23 and date <= 10.22:
+ return sign[6]
+ elif date >= 10.23 and date <= 11.21:
+ return sign[7]
+ elif date >= 11.22 and date <= 12.21:
+ return sign[8]
+ elif date >= 12.22 or date <= 1.19:
+ return sign[9]
+ elif date >= 1.20 and date <= 2.18:
+ return sign[10]
+ elif date >= 2.19 and date <= 3.20:
+ return sign[11]