Решение на Хороскоп от Димитър Петров

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

Към профила на Димитър Петров

Резултати

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

Код

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

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

F
Stdout:
Водолей
F
Stdout:
Овен
F
Stdout:
Рак
F
Stdout:
Козирог
F
Stdout:
Близнаци
F
Stdout:
Лъв
F
Stdout:
Везни
F
Stdout:
Близнаци
F
Stdout:
Близнаци
F
Stdout:
Риби
F
Stdout:
Стрелец
F
Stdout:
Скорпион
F
Stdout:
Близнаци
F
Stdout:
Телец
F
Stdout:
Дева

======================================================================
FAIL: test_aquaris (test.HoroscopeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/d20130307-16279-1i1ixkg/test.py", line 38, in test_aquaris
    self.assertEqual(solution.what_is_my_sign(2, 2), 'Водолей')
AssertionError: None != 'Водолей'

Stdout:
Водолей

======================================================================
FAIL: test_aries (test.HoroscopeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/d20130307-16279-1i1ixkg/test.py", line 8, in test_aries
    self.assertEqual(solution.what_is_my_sign(1, 4), 'Овен')
AssertionError: None != 'Овен'

Stdout:
Овен

======================================================================
FAIL: test_cancer (test.HoroscopeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/d20130307-16279-1i1ixkg/test.py", line 17, in test_cancer
    self.assertEqual(solution.what_is_my_sign(8, 7), 'Рак')
AssertionError: None != 'Рак'

Stdout:
Рак

======================================================================
FAIL: test_capricorn (test.HoroscopeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/d20130307-16279-1i1ixkg/test.py", line 35, in test_capricorn
    self.assertEqual(solution.what_is_my_sign(1, 1), 'Козирог')
AssertionError: None != 'Козирог'

Stdout:
Козирог

======================================================================
FAIL: test_gemini (test.HoroscopeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/d20130307-16279-1i1ixkg/test.py", line 14, in test_gemini
    self.assertEqual(solution.what_is_my_sign(16, 6), 'Близнаци')
AssertionError: None != 'Близнаци'

Stdout:
Близнаци

======================================================================
FAIL: test_leo (test.HoroscopeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/d20130307-16279-1i1ixkg/test.py", line 20, in test_leo
    self.assertEqual(solution.what_is_my_sign(1, 8), 'Лъв')
AssertionError: None != 'Лъв'

Stdout:
Лъв

======================================================================
FAIL: test_libra (test.HoroscopeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/d20130307-16279-1i1ixkg/test.py", line 26, in test_libra
    self.assertEqual(solution.what_is_my_sign(5, 10), 'Везни')
AssertionError: None != 'Везни'

Stdout:
Везни

======================================================================
FAIL: test_living_on_the_edge (test.HoroscopeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/d20130307-16279-1i1ixkg/test.py", line 44, in test_living_on_the_edge
    self.assertEqual(solution.what_is_my_sign(20, 6), 'Близнаци')
AssertionError: None != 'Близнаци'

Stdout:
Близнаци

======================================================================
FAIL: test_named_arguments (test.HoroscopeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/d20130307-16279-1i1ixkg/test.py", line 50, in test_named_arguments
    self.assertEqual(solution.what_is_my_sign(month=6, day=20), 'Близнаци')
AssertionError: None != 'Близнаци'

Stdout:
Близнаци

======================================================================
FAIL: test_pisces (test.HoroscopeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/d20130307-16279-1i1ixkg/test.py", line 41, in test_pisces
    self.assertEqual(solution.what_is_my_sign(9, 3), 'Риби')
AssertionError: None != 'Риби'

Stdout:
Риби

======================================================================
FAIL: test_sagittarius (test.HoroscopeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/d20130307-16279-1i1ixkg/test.py", line 32, in test_sagittarius
    self.assertEqual(solution.what_is_my_sign(11, 12), 'Стрелец')
AssertionError: None != 'Стрелец'

Stdout:
Стрелец

======================================================================
FAIL: test_scorpio (test.HoroscopeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/d20130307-16279-1i1ixkg/test.py", line 29, in test_scorpio
    self.assertEqual(solution.what_is_my_sign(7, 11), 'Скорпион')
AssertionError: None != 'Скорпион'

Stdout:
Скорпион

======================================================================
FAIL: test_sludge (test.HoroscopeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/d20130307-16279-1i1ixkg/test.py", line 47, in test_sludge
    self.assertEqual(solution.what_is_my_sign(21, 5), 'Близнаци')
AssertionError: None != 'Близнаци'

Stdout:
Близнаци

======================================================================
FAIL: test_taurus (test.HoroscopeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/d20130307-16279-1i1ixkg/test.py", line 11, in test_taurus
    self.assertEqual(solution.what_is_my_sign(6, 5), 'Телец')
AssertionError: None != 'Телец'

Stdout:
Телец

======================================================================
FAIL: test_virgo (test.HoroscopeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/d20130307-16279-1i1ixkg/test.py", line 23, in test_virgo
    self.assertEqual(solution.what_is_my_sign(2, 9), 'Дева')
AssertionError: None != 'Дева'

Stdout:
Дева

----------------------------------------------------------------------
Ran 15 tests in 0.005s

FAILED (failures=15)

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

Димитър обнови решението на 03.03.2013 18:51 (преди над 11 години)

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