Body Mass Index

Краен срок
04.03.2016 20:00

Срокът за предаване на решения е отминал

Тъй като лятото наближава и все повече хора се замислят за физическата форма, в която се намират, искаме от вас да напишете едно калкулаторче за Body Mass Index.

Напишете функция def body_mass_index(weight, height), която по зададено тегло (в килограми) и височина (в метри) връща BMI коефицент.

Напишете също така функция def shape_of(weight, height), която по зададено тегло (в килограми) и височина (в метри) връща:

  • 'тежко недохранване' при BMI <= 15
  • 'средно недохранване' при >15 и <=16
  • 'леко недохранване' при >16 и <= 18.5
  • 'нормално тегло' при >18.5 и <=25
  • 'наднормено тегло' при >25 и <=30
  • 'затлъстяване I степен' при >30 и <=35
  • 'затлъстяване II степен' при >35 и <=40
  • 'затлъстяване III степен' при >40

Формулата е:

$$ BMI = \frac{mass_{kg}}{height_m^2} $$

Решения

Николай Лазаров
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Николай Лазаров
def body_mass_index(weight, height):
return weight / (height**2)
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
if bmi <= 15:
return 'тежко недохранване'
elif bmi > 15 and bmi <= 16:
return 'средно недохранване'
elif bmi > 16 and bmi <= 18.5:
return 'леко недохранване'
elif bmi > 18.5 and bmi <= 25:
return 'нормално тегло'
elif bmi > 25 and bmi <= 30:
return 'наднормено тегло'
elif bmi > 30 and bmi <= 35:
return 'затлъстяване I степен'
elif bmi > 35 and bmi <= 40:
return 'затлъстяване II степен'
elif bmi > 40:
return 'затлъстяване III степен'
..........
----------------------------------------------------------------------
Ran 10 tests in 0.076s

OK
Теодор Тошков
  • Некоректно
  • 1 успешни тест(а)
  • 9 неуспешни тест(а)
Теодор Тошков
def body_mass_index(weight, height):
return weight / height ** 2
def shape_of(weight, height):
BMI = body_mass_index(weight, height)
if BMI <= 15: print('тежко недохранване')
elif BMI <= 16: print('средно недохранване')
elif BMI <= 18.5: print('леко недохранване')
elif BMI <= 25: print('нормално тегло')
elif BMI <= 30: print('наднормено тегло')
elif BMI <= 35: print('затлъстяване I степен')
elif BMI <= 40: print('затлъстяване II степен')
else: print('затлъстяване III степен')
.FFFFFFFFF
======================================================================
FAIL: test_edge_case (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване II степен' != None

======================================================================
FAIL: test_normal_weight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'нормално тегло' != None

======================================================================
FAIL: test_obese_class_I (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване I степен' != None

======================================================================
FAIL: test_obese_class_II (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване II степен' != None

======================================================================
FAIL: test_obese_class_III (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване III степен' != None

======================================================================
FAIL: test_overweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'наднормено тегло' != None

======================================================================
FAIL: test_severely_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'средно недохранване' != None

======================================================================
FAIL: test_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'леко недохранване' != None

======================================================================
FAIL: test_very_severely_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'тежко недохранване' != None

----------------------------------------------------------------------
Ran 10 tests in 0.086s

FAILED (failures=9)
Александра Матева
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Александра Матева
def body_mass_index(weight, height):
return weight / (height ** 2)
def shape_of(weight, height):
stoynosti = {15: 'тежко недохранване',
16: 'средно недохранване',
18.5: 'леко недохранване',
25: 'нормално тегло',
30: 'наднормено тегло',
35: 'затлъстяване I степен',
40: 'затлъстяване II степен'}
BMI = body_mass_index(weight, height)
for stoynost in sorted(stoynosti):
if BMI <= stoynost:
return stoynosti[stoynost]
return 'затлъстяване III степен'
..........
----------------------------------------------------------------------
Ran 10 tests in 0.075s

OK
Виктор Маринов
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Виктор Маринов
def body_mass_index(weight, height):
bmi = weight / height**2
return bmi
def shape_of(weight, height):
bmi = body_mass_index(weight,height)
if bmi <= 15:
return 'тежко недохранване'
elif bmi > 15 and bmi <= 16:
return 'средно недохранване'
elif bmi > 16 and bmi <= 18.5:
return 'леко недохранване'
elif bmi > 18.5 and bmi <= 25:
return 'нормално тегло'
elif bmi > 25 and bmi <= 30:
return 'наднормено тегло'
elif bmi > 30 and bmi <= 35:
return 'затлъстяване I степен'
elif bmi > 35 and bmi <= 40:
return 'затлъстяване II степен'
elif bmi > 40:
return 'затлъстяване III степен'
..........
----------------------------------------------------------------------
Ran 10 tests in 0.076s

OK
Денис Михайлов
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Денис Михайлов
def body_mass_index(weight, height):
return weight / (height * height)
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
if bmi <= 15:
return 'тежко недохранване'
elif bmi <= 16:
return 'средно недохранване'
elif bmi <= 18.5:
return 'леко недохранване'
elif bmi <= 25:
return 'нормално тегло'
elif bmi <= 30:
return 'наднормено тегло'
elif bmi <= 35:
return 'затлъстяване I степен'
elif bmi <= 40:
return 'затлъстяване II степен'
else:
return 'затлъстяване III степен'
..........
----------------------------------------------------------------------
Ran 10 tests in 0.080s

OK
Десислава Цветкова
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Десислава Цветкова
CATEGORIES = {(0, 15): 'тежко недохранване',
(15, 16): 'средно недохранване',
(16, 18.5): 'леко недохранване',
(18.5, 25): 'нормално тегло',
(25, 30): 'наднормено тегло',
(30, 35): 'затлъстяване I степен',
(35, 40): 'затлъстяване II степен',
(40, 10 ** 20): 'затлъстяване III степен'}
def body_mass_index(weight, height):
return weight / height ** 2
def checkRange(bmi):
for bmis, status in CATEGORIES.items():
if bmis[0] < bmi and bmi <= bmis[1]:
return status
def shape_of(weight, height):
return checkRange(body_mass_index(weight, height))
..........
----------------------------------------------------------------------
Ran 10 tests in 0.080s

OK
Веселин Иванов
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Веселин Иванов
def body_mass_index(weight, height):
return round(weight/(height ** 2), 3)
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
if bmi <= 15:
return "тежко недохранване"
elif bmi > 15 and bmi <= 16:
return "средно недохранване"
elif bmi > 16 and bmi <= 18.5:
return "леко недохранване"
elif bmi > 18.5 and bmi <= 25:
return "нормално тегло"
elif bmi > 25 and bmi <= 30:
return "наднормено тегло"
elif bmi > 30 and bmi <= 35:
return "затлъстяване I степен"
elif bmi > 35 and bmi <= 40:
return "затлъстяване II степен"
else:
return "затлъстяване III степен"
..........
----------------------------------------------------------------------
Ran 10 tests in 0.075s

OK
Емил Илиев
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Емил Илиев
def body_mass_index(weight, height):
return round(weight / height ** 2, 1)
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
if bmi <= 15:
return "тежко недохранване"
elif bmi > 15 and bmi <= 16:
return "средно недохранване"
elif bmi > 16 and bmi <= 18.5:
return "леко недохранване"
elif bmi > 18.5 and bmi <= 25:
return "нормално тегло"
elif bmi > 25 and bmi <= 30:
return "наднормено тегло"
elif bmi > 30 and bmi <= 35:
return "затлъстяване I степен"
elif bmi > 35 and bmi <= 40:
return "затлъстяване II степен"
else:
return "затлъстяване III степен"
..........
----------------------------------------------------------------------
Ran 10 tests in 0.266s

OK
Георги Данков
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Георги Данков
def body_mass_index(weight, height):
return round(weight/(height ** 2), 3)
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
if bmi <= 15:
return'тежко недохранване'
elif bmi > 15 and bmi <= 16:
return'средно недохранване'
elif bmi > 16 and bmi <= 18.5:
return'леко недохранване'
elif bmi > 18.5 and bmi <= 25:
return'нормално тегло'
elif bmi > 25 and bmi <= 30:
return'наднормено тегло'
elif bmi > 30 and bmi <= 35:
return'затлъстяване I степен'
elif bmi > 35 and bmi <= 40:
return'затлъстяване II степен'
elif bmi > 40:
return'затлъстяване III степен'
..........
----------------------------------------------------------------------
Ran 10 tests in 0.076s

OK
Николай Желязков
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Николай Желязков
def body_mass_index(weight, height):
return weight / height ** 2
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
if bmi <= 15:
return 'тежко недохранване'
elif bmi <= 16:
return 'средно недохранване'
elif bmi <= 18.5:
return 'леко недохранване'
elif bmi <= 25:
return 'нормално тегло'
elif bmi <= 30:
return 'наднормено тегло'
elif bmi <= 35:
return 'затлъстяване I степен'
elif bmi <= 40:
return 'затлъстяване II степен'
else:
return 'затлъстяване III степен'
..........
----------------------------------------------------------------------
Ran 10 tests in 0.075s

OK
Алекс Николов
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Алекс Николов
def body_mass_index(weight, height):
return weight / (height ** 2)
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
if bmi <= 15:
return 'тежко недохранване'
elif bmi > 15 and bmi <= 16:
return 'средно недохранване'
elif bmi > 16 and bmi <= 18.5:
return 'леко недохранване'
elif bmi > 18.5 and bmi <= 25:
return 'нормално тегло'
elif bmi > 25 and bmi <= 30:
return 'наднормено тегло'
elif bmi > 30 and bmi <= 35:
return 'затлъстяване I степен'
elif bmi > 35 and bmi <= 40:
return 'затлъстяване II степен'
else:
return 'затлъстяване III степен'
..........
----------------------------------------------------------------------
Ran 10 tests in 0.075s

OK
Тина Накова
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Тина Накова
def body_mass_index(weight, height):
return weight/(height ** 2)
def shape_of(weight, height):
shapes = [ ("затлъстяване III степен", 40),
("затлъстяване II степен", 35),
("затлъстяване I степен", 30),
("наднормено тегло", 25),
("нормално тегло", 18.5),
("леко недохранване", 16),
("средно недохранване", 15),
("тежко недохранване", 0) ]
BMI = body_mass_index(weight, height)
for shape in shapes:
if BMI > shape[1]:
return shape[0]
return -1
..........
----------------------------------------------------------------------
Ran 10 tests in 0.075s

OK
Илия Жечев
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Илия Жечев
def body_mass_index(weight, height):
if height == 0:
return 0
return weight / (height * height)
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
if bmi <= 15:
return 'тежко недохранване'
elif bmi <= 16:
return 'средно недохранване'
elif bmi <= 18.5:
return 'леко недохранване'
elif bmi <= 25:
return 'нормално тегло'
elif bmi <= 30:
return 'наднормено тегло'
elif bmi <= 35:
return 'затлъстяване I степен'
elif bmi <= 40:
return 'затлъстяване II степен'
else:
return 'затлъстяване III степен'
..........
----------------------------------------------------------------------
Ran 10 tests in 0.090s

OK
Евгени Кунев
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Евгени Кунев
values = {
'тежко недохранване': (float('-inf'), 15),
'средно недохранване': (15, 16),
'леко недохранване': (16, 18.5),
'нормално тегло': (18.5, 25),
'наднормено тегло': (25, 30),
'затлъстяване I степен': (30, 35),
'затлъстяване II степен': (35, 40),
'затлъстяване III степен': (40, float('inf')),
}
def is_between(value, minimum, maximum):
return minimum < value <= maximum
def body_mass_index(weight, height):
return weight / height ** 2
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
for shape, boundaries in values.items():
if is_between(bmi, *boundaries):
return shape
..........
----------------------------------------------------------------------
Ran 10 tests in 0.081s

OK
Кузман Белев
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Кузман Белев
def body_mass_index(weight, height):
return weight / height ** 2
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
if bmi <= 15:
return 'тежко недохранване'
elif bmi <= 16:
return 'средно недохранване'
elif bmi <= 18.5:
return 'леко недохранване'
elif bmi <= 25:
return 'нормално тегло'
elif bmi <= 30:
return 'наднормено тегло'
elif bmi <= 35:
return 'затлъстяване I степен'
elif bmi <= 40:
return 'затлъстяване II степен'
else:
return 'затлъстяване III степен'
..........
----------------------------------------------------------------------
Ran 10 tests in 0.076s

OK
Христо Ралев
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Христо Ралев
def body_mass_index(weight, height):
return weight / (height * height)
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
#print ("Вашият индекс е: ", bmi)
bmis = {(0, 15) : 'тежко недохранване',
(15, 16) : 'средно недохранване',
(16, 18.5) : 'леко недохранване',
(18.5, 25) : 'нормално тегло',
(25, 30) : 'наднормено тегло',
(30, 35) : 'затлъстяване I степен',
(35, 40) : 'затлъстяване II степен',
(40, 1000) : 'затлъстяване III степен'
}
for (frm,to), info in bmis.items():
if bmi > frm and bmi <= to:
return info
..........
----------------------------------------------------------------------
Ran 10 tests in 0.075s

OK
Атанас Василев
  • Некоректно
  • 1 успешни тест(а)
  • 9 неуспешни тест(а)
Атанас Василев
def body_mass_index(weight, height):
return weight/(height * height)
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
if bmi <= 15:
print("тежко недохранване")
elif (bmi > 15 and bmi <= 16):
print("средно недохранване")
elif (bmi > 16 and bmi <= 18.5):
print("леко недохранване")
elif (bmi > 18.5 and bmi <= 25):
print("нормално тегло")
elif (bmi > 25 and bmi <= 30):
print("наднормено тегло")
elif (bmi > 30 and bmi <= 35):
print("затлъстяване I степен")
elif (bmi > 35 and bmi <= 40):
print("затлъстяване II степен")
else:
print("затлъстяване III степен")
.FFFFFFFFF
======================================================================
FAIL: test_edge_case (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване II степен' != None

======================================================================
FAIL: test_normal_weight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'нормално тегло' != None

======================================================================
FAIL: test_obese_class_I (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване I степен' != None

======================================================================
FAIL: test_obese_class_II (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване II степен' != None

======================================================================
FAIL: test_obese_class_III (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване III степен' != None

======================================================================
FAIL: test_overweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'наднормено тегло' != None

======================================================================
FAIL: test_severely_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'средно недохранване' != None

======================================================================
FAIL: test_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'леко недохранване' != None

======================================================================
FAIL: test_very_severely_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'тежко недохранване' != None

----------------------------------------------------------------------
Ran 10 tests in 0.079s

FAILED (failures=9)
Николай Мантаров
  • Некоректно
  • 1 успешни тест(а)
  • 9 неуспешни тест(а)
Николай Мантаров
import math
def body_mass_index(weight, height):
BMI=weight / (height ** 2)
return math.ceil(BMI*100)/100
def shape_of(weight, height):
BMI=body_mass_index(weight,height)
if BMI<=15:
print('тежко недохранване')
elif BMI<=16:
print('средно недохранване')
elif BMI<=18.5:
print('леко недохранване')
elif BMI<=25:
print('нормално тегло')
elif BMI<=30:
print('наднормено тегло')
elif BMI<=35:
print('затлъстяване I степен')
elif BMI<=40:
print('затлъстяване II степен')
else:
print('затлъстяване III степен')
.FFFFFFFFF
======================================================================
FAIL: test_edge_case (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване II степен' != None

======================================================================
FAIL: test_normal_weight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'нормално тегло' != None

======================================================================
FAIL: test_obese_class_I (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване I степен' != None

======================================================================
FAIL: test_obese_class_II (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване II степен' != None

======================================================================
FAIL: test_obese_class_III (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване III степен' != None

======================================================================
FAIL: test_overweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'наднормено тегло' != None

======================================================================
FAIL: test_severely_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'средно недохранване' != None

======================================================================
FAIL: test_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'леко недохранване' != None

======================================================================
FAIL: test_very_severely_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'тежко недохранване' != None

----------------------------------------------------------------------
Ran 10 tests in 0.080s

FAILED (failures=9)
Ивета Чампоева
  • Некоректно
  • 1 успешни тест(а)
  • 9 неуспешни тест(а)
Ивета Чампоева
def body_mass_index (weight, height) :
return weight/height**2
def shape_of(weight, height) :
mass = body_mass_index(weight, height)
if mass <= 15 : print("тежко недохранване")
elif mass <= 16 : print("средно недохранване")
elif mass <= 18.5 : print("леко недохранване")
elif mass <= 25 : print("нормално тегло")
elif mass <= 30 : print("наднормено тегло")
elif mass <= 35 : print("затлъстяване I степен")
elif mass <= 40 : print("затлъстяване II степен")
else : print("затлъстяване III степен")
return
.FFFFFFFFF
======================================================================
FAIL: test_edge_case (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване II степен' != None

======================================================================
FAIL: test_normal_weight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'нормално тегло' != None

======================================================================
FAIL: test_obese_class_I (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване I степен' != None

======================================================================
FAIL: test_obese_class_II (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване II степен' != None

======================================================================
FAIL: test_obese_class_III (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване III степен' != None

======================================================================
FAIL: test_overweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'наднормено тегло' != None

======================================================================
FAIL: test_severely_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'средно недохранване' != None

======================================================================
FAIL: test_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'леко недохранване' != None

======================================================================
FAIL: test_very_severely_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'тежко недохранване' != None

----------------------------------------------------------------------
Ran 10 tests in 0.080s

FAILED (failures=9)
Тодор Димов
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Тодор Димов
def body_mass_index(weight, height):
return weight / height ** 2
def shape_of(weight, height):
if body_mass_index(weight, height) <= 15:
return 'тежко недохранване'
elif body_mass_index(weight, height) <=16:
return 'средно недохранване'
elif body_mass_index(weight, height) <= 18.5:
return 'леко недохранване'
elif body_mass_index(weight, height) <=25:
return 'нормално тегло'
elif body_mass_index(weight, height) <=30:
return 'наднормено тегло'
elif body_mass_index(weight, height) <=35:
return 'затлъстяване I степен'
elif body_mass_index(weight, height) <=40:
return 'затлъстяване II степен'
else:
return 'затлъстяване III степен'
..........
----------------------------------------------------------------------
Ran 10 tests in 0.075s

OK
Борис Алтънов
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Борис Алтънов
def body_mass_index(weight, height):
return round(weight / height ** 2, 1)
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
if bmi <= 15:
return 'тежко недохранване'
elif bmi > 15 and bmi <= 16:
return 'средно недохранване'
elif bmi > 16 and bmi <= 18.5:
return 'леко недохранване'
elif bmi > 18.5 and bmi <= 25:
return 'нормално тегло'
elif bmi > 25 and bmi <= 30:
return 'наднормено тегло'
elif bmi > 30 and bmi <= 35:
return 'затлъстяване I степен'
elif bmi > 35 and bmi <= 40:
return 'затлъстяване II степен'
elif bmi > 40:
return 'затлъстяване III степен'
..........
----------------------------------------------------------------------
Ran 10 tests in 0.076s

OK
Марио Даскалов
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Марио Даскалов
def body_mass_index(weight, height):
return weight / height ** 2
def shape_of(weight, height):
shape_states = (
('тежко недохранване', -1, 15),
('средно недохранване', 15, 16),
('леко недохранване', 16, 18.5),
('нормално тегло', 18.5, 25),
('наднормено тегло', 25, 30),
('затлъстяване I степен', 30, 35),
('затлъстяване II степен', 35, 40),
('затлъстяване III степен', 40, float('inf')),
)
mass_index = body_mass_index(weight, height)
for message, lower_limit, upper_limit in shape_states:
if mass_index > lower_limit and mass_index <= upper_limit:
return message
..........
----------------------------------------------------------------------
Ran 10 tests in 0.076s

OK
Александрина Ламбова
  • Некоректно
  • 1 успешни тест(а)
  • 9 неуспешни тест(а)
Александрина Ламбова
def body_mass_index(weight,height):
return weight/(height*height)
def shape_of(weight,height):
BMI=body_mass_index(weight,height)
if BMI<=15: print("тежко недохранване")
elif BMI>15 and BMI<=16: print("средно недохранване")
elif BMI>16 and BMI<=18.5: print("леко недохранване")
elif BMI>18.5 and BMI<=25: print("нормално тегло")
elif BMI>25 and BMI<=30: print("наднормено тегло")
elif BMI>30 and BMI<=35: print("затлъстяване | степен")
elif BMI>35 and BMI<=40: print("затлъстяване || степен")
elif BMI>40: print("затлъстяване ||| степен")
.FFFFFFFFF
======================================================================
FAIL: test_edge_case (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване II степен' != None

======================================================================
FAIL: test_normal_weight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'нормално тегло' != None

======================================================================
FAIL: test_obese_class_I (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване I степен' != None

======================================================================
FAIL: test_obese_class_II (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване II степен' != None

======================================================================
FAIL: test_obese_class_III (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване III степен' != None

======================================================================
FAIL: test_overweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'наднормено тегло' != None

======================================================================
FAIL: test_severely_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'средно недохранване' != None

======================================================================
FAIL: test_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'леко недохранване' != None

======================================================================
FAIL: test_very_severely_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'тежко недохранване' != None

----------------------------------------------------------------------
Ran 10 tests in 0.079s

FAILED (failures=9)
Емануил Антонов
  • Некоректно
  • 1 успешни тест(а)
  • 9 неуспешни тест(а)
Емануил Антонов
def body_mass_index(weight, hight):
return weight / hight ** 2
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
if bmi <= 15:
print("тежко недохранване")
elif bmi <= 16:
print("средно недохранване")
elif bmi <= 18.5:
print("леко недохранване")
elif bmi <= 25:
print("нормално тегло")
elif bmi <= 30:
print("затлъстяване I степен")
elif bmi <= 35:
print("затлъстяване II степен")
elif bmi <= 40:
print("затлъстяване III степен")
.FFFFFFFFF
======================================================================
FAIL: test_edge_case (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване II степен' != None

======================================================================
FAIL: test_normal_weight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'нормално тегло' != None

======================================================================
FAIL: test_obese_class_I (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване I степен' != None

======================================================================
FAIL: test_obese_class_II (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване II степен' != None

======================================================================
FAIL: test_obese_class_III (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване III степен' != None

======================================================================
FAIL: test_overweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'наднормено тегло' != None

======================================================================
FAIL: test_severely_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'средно недохранване' != None

======================================================================
FAIL: test_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'леко недохранване' != None

======================================================================
FAIL: test_very_severely_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'тежко недохранване' != None

----------------------------------------------------------------------
Ran 10 tests in 0.080s

FAILED (failures=9)
Стилиян Стоянов
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Стилиян Стоянов
def body_mass_index(weight, height):
return weight / (height * height)
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
min = 0
index_boundaries = [40, 35, 30, 25, 18.5, 16, 15, min]
diagnoses = {min: 'тежко недохранване',
15: 'средно недохранване',
16: 'леко недохранване',
18.5: 'нормално тегло',
25: 'наднормено тегло',
30: 'затлъстяване I степен',
35: 'затлъстяване II степен',
40: 'затлъстяване III степен'}
for index in index_boundaries:
if bmi > index:
return diagnoses[index]
..........
----------------------------------------------------------------------
Ran 10 tests in 0.075s

OK
Георги Иванов
  • Некоректно
  • 9 успешни тест(а)
  • 1 неуспешни тест(а)
Георги Иванов
def body_mass_index(weight, height):
return round(weight/(height**2), 2)
def shape_of(weight, height):
bmi = body_mass_index(weight,height)
if bmi <= 15:
return "тежко недохранване"
elif bmi > 15 and bmi <= 16:
return "средно недохранване"
elif bmi > 16 and bmi <= 18.5:
return "леко недохранване"
elif bmi > 18.5 and bmi <= 25:
return "нормално тегло"
elif bmi > 25 and bmi <= 30:
return "наднормено тегло"
elif bmi > 30 and bmi <= 35:
return "затлъстяване I степен"
elif bmi > 35 and bmi <= 40:
return "затлъстяване II степен"
elif bmi > 40:
return "затлъстяване II степен"
.....F....
======================================================================
FAIL: test_obese_class_III (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване III степен' != 'затлъстяване II степен'
- затлъстяване III степен
?                -
+ затлъстяване II степен


----------------------------------------------------------------------
Ran 10 tests in 0.078s

FAILED (failures=1)
Александър Наджарян
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Александър Наджарян
BMI_SHAPE = (
(40, 'затлъстяване III степен'),
(35, 'затлъстяване II степен'),
(30, 'затлъстяване I степен'),
(25, 'наднормено тегло'),
(18.5, 'нормално тегло'),
(16, 'леко недохранване'),
(15, 'средно недохранване'),
(0, 'тежко недохранване'),
)
def body_mass_index(weight, height):
return round(weight / height ** 2, 1)
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
for body_type in BMI_SHAPE:
if bmi > body_type[0]:
return body_type[1]
..........
----------------------------------------------------------------------
Ran 10 tests in 0.077s

OK
Даниел Шушков
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Даниел Шушков
def body_mass_index(weight, height):
return round(weight / height**2,2)
def shape_of(weight, height):
bmi = body_mass_index(weight , height)
if bmi <= 15 : return 'тежко недохранване'
elif bmi > 15 and bmi <= 16 : return 'средно недохранване'
elif bmi > 16 and bmi <= 18.5 : return 'леко недохранване'
elif bmi > 18.5 and bmi <= 25 : return 'нормално тегло'
elif bmi > 25 and bmi <= 30 : return 'наднормено тегло'
elif bmi > 30 and bmi <= 35 : return 'затлъстяване I степен'
elif bmi > 35 and bmi <= 40 : return 'затлъстяване II степен'
else : return 'затлъстяване III степен'
..........
----------------------------------------------------------------------
Ran 10 tests in 0.077s

OK
Иван Камбуров
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Иван Камбуров
def body_mass_index(weight, height):
return weight / (height ** 2)
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
if bmi <= 15:
return 'тежко недохранване'
elif bmi > 15 and bmi <= 16:
return 'средно недохранване'
elif bmi > 16 and bmi <= 18.5:
return 'леко недохранване'
elif bmi > 18.5 and bmi <= 25:
return 'нормално тегло'
elif bmi > 25 and bmi <= 30:
return 'наднормено тегло'
elif bmi > 30 and bmi <= 35:
return 'затлъстяване I степен'
elif bmi > 35 and bmi <= 40:
return 'затлъстяване II степен'
elif bmi > 40:
return 'затлъстяване III степен'
..........
----------------------------------------------------------------------
Ran 10 tests in 0.078s

OK
Мартин Терзийски
  • Некоректно
  • 1 успешни тест(а)
  • 9 неуспешни тест(а)
Мартин Терзийски
def body_mass_index(weight,height):
x = round(weight/(height**2),2)
return x
def shape_of(weight,height):
x = body_mass_index(weight,height)
if(x<=15):
print("тежко недохранване")
elif(x<=16):
print("средно недохранване")
elif(x<=18.5):
print("леко недохранване")
elif(x<=25):
print("нормално тегло")
elif(x<=30):
print("наднормено тегло")
elif(x<=35):
print("затлъстяване I степен")
elif(x<=40):
print("затлъстяване II степен")
else:
print("затлъстяване III степен")
.FFFFFFFFF
======================================================================
FAIL: test_edge_case (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване II степен' != None

======================================================================
FAIL: test_normal_weight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'нормално тегло' != None

======================================================================
FAIL: test_obese_class_I (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване I степен' != None

======================================================================
FAIL: test_obese_class_II (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване II степен' != None

======================================================================
FAIL: test_obese_class_III (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване III степен' != None

======================================================================
FAIL: test_overweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'наднормено тегло' != None

======================================================================
FAIL: test_severely_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'средно недохранване' != None

======================================================================
FAIL: test_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'леко недохранване' != None

======================================================================
FAIL: test_very_severely_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'тежко недохранване' != None

----------------------------------------------------------------------
Ran 10 tests in 0.082s

FAILED (failures=9)
Данислав Киров
  • Некоректно
  • 0 успешни тест(а)
  • 0 неуспешни тест(а)
Данислав Киров
def body_mass_index(weight, height):
return weight / (height ** 2)
def shape_of(weight, height):
bmi = round(body_mass_index(weight, height), 1)
if bmi <= 15:
return 'тежко недохранване'
elif bmi > 15 and bmi <= 16:
return 'средно недохранване'
elif bmi > 16 and bmi <= 18.5:
return 'леко недохранване'
elif bmi > 18.5 and bmi <= 25:
return 'нормално тегло'
elif bmi > 25 and bmi <= 30:
return 'наднормено тегло'
elif bmi > 30 and bmi <= 35:
return 'затлъстяване I степен'
elif bmi > 35 and bmi <= 40:
return 'затлъстяване II степен'
else:
return 'затлъстяване III степен'
weight = float(input("Enter weight (in kg): "))
height = float(input("Enter height (in m): "))
print(shape_of(weight, height))
Enter weight (in kg): EOF when reading a line
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 114, in main
    loaded_test = imp.load_source('test', test_module)
  File "/usr/local/lib/python3.5/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 693, in _load
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 662, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/tmp/d20160307-25958-pwlhos/test.py", line 3, in <module>
    import solution
  File "/tmp/d20160307-25958-pwlhos/solution.py", line 23, in <module>
    weight = float(input("Enter weight (in kg): "))
Андрей Иванов
  • Некоректно
  • 1 успешни тест(а)
  • 9 неуспешни тест(а)
Андрей Иванов
def body_mass_index(weight,height):
return round(weight/(height**2),2)
def shape_of(weight,height):
bmi = body_mass_index(weight,height)
if bmi<=15:
print("тежко недохранване")
elif bmi>15 and bmi<=16:
print("средно недохранване")
elif bmi>16 and bmi<=18.5:
print("леко недохранване")
elif bmi>18.5 and bmi<=25:
print("нормално тегло")
elif bmi>25 and bmi<=30:
print("наднормено тегло")
elif bmi>30 and bmi<=35:
print("затлъстяване I степен")
elif bmi>35 and bmi<=40:
print("затлъстяване II степен")
else:
print("затлъстяване III степен")
.FFFFFFFFF
======================================================================
FAIL: test_edge_case (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване II степен' != None

======================================================================
FAIL: test_normal_weight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'нормално тегло' != None

======================================================================
FAIL: test_obese_class_I (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване I степен' != None

======================================================================
FAIL: test_obese_class_II (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване II степен' != None

======================================================================
FAIL: test_obese_class_III (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване III степен' != None

======================================================================
FAIL: test_overweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'наднормено тегло' != None

======================================================================
FAIL: test_severely_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'средно недохранване' != None

======================================================================
FAIL: test_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'леко недохранване' != None

======================================================================
FAIL: test_very_severely_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'тежко недохранване' != None

----------------------------------------------------------------------
Ran 10 tests in 0.080s

FAILED (failures=9)
Даниел Делчев
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Даниел Делчев
def body_mass_index(weight, height):
if weight <= 0 or height <= 0:
print("Invalid input!")
return None
else:
return round(weight / (height * height), 1)
def shape_of(weight, height):
if weight <= 0 or height <= 0:
return "Invalid input!"
else:
index = body_mass_index(weight, height)
if index <= 15:
return "тежко недохранване"
elif 15 < index <= 16:
return "средно недохранване"
elif 16 < index <= 18.5:
return "леко недохранване"
elif 18.5 < index <= 25:
return "нормално тегло"
elif 25 < index <= 30:
return "наднормено тегло"
elif 30 < index <= 35:
return "затлъстяване I степен"
elif 35 < index <= 40:
return "затлъстяване II степен"
elif index > 40:
return "затлъстяване III степен"
..........
----------------------------------------------------------------------
Ran 10 tests in 0.076s

OK
Иван Вичев
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Иван Вичев
SHAPES = ["тежко недохранване", "средно недохранване", "леко недохранване",
"нормално тегло", "наднормено тегло", "затлъстяване I степен",
"затлъстяване II степен", "затлъстяване III степен"]
def body_mass_index(weight, height):
return weight/pow(height,2)
def shape_of(weight, height):
bmi = body_mass_index(weight,height)
if(bmi <= 15):
return SHAPES[0]
elif(bmi > 15 and bmi <= 16):
return SHAPES[1]
elif(bmi > 16 and bmi <= 18.5):
return SHAPES[2]
elif(bmi > 18.5 and bmi <= 25):
return SHAPES[3]
elif(bmi > 25 and bmi <= 30):
return SHAPES[4]
elif(bmi > 30 and bmi <= 35):
return SHAPES[5]
elif(bmi > 35 and bmi <= 40):
return SHAPES[6]
else:
return SHAPES[7]
..........
----------------------------------------------------------------------
Ran 10 tests in 0.076s

OK
Кристофър Митов
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Кристофър Митов
def body_mass_index(weight, height):
return round(weight / (height**2), 2)
def shape_of(weight, height):
BMI = body_mass_index(weight, height)
if BMI <= 15:
return('тежко недохранване')
elif BMI > 15 and BMI <=16:
return('средно недохранване')
elif BMI > 16 and BMI <= 18.5:
return('леко недохранване')
elif BMI > 18.5 and BMI <= 25:
return('нормално тегло')
elif BMI > 25 and BMI <= 30:
return('наднормено тегло')
elif BMI > 30 and BMI <= 35:
return('затлъстяване I степен')
elif BMI > 35 and BMI <= 40:
return('затлъстяване II степен')
else:
return('затлъстяване III степен')
..........
----------------------------------------------------------------------
Ran 10 tests in 0.076s

OK
Кристина Христакиева
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Кристина Христакиева
def body_mass_index(weight, height):
return weight / height**2
def shape_of(weight, height):
bmi = round(body_mass_index(weight, height), 1)
if bmi <= 15:
return 'тежко недохранване'
elif bmi <= 16:
return 'средно недохранване'
elif bmi <= 18.5:
return 'леко недохранване'
elif bmi <= 25:
return 'нормално тегло'
elif bmi <= 30:
return 'наднормено тегло'
elif bmi <= 35:
return 'затлъстяване I степен'
elif bmi <= 40:
return 'затлъстяване II степен'
else:
return 'затлъстяване III степен'
..........
----------------------------------------------------------------------
Ran 10 tests in 0.076s

OK
Светомир Стоименов
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Светомир Стоименов
def body_mass_index(weight, height):
return weight/height**2
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
if bmi <= 15:
return 'тежко недохранване'
elif bmi <= 16:
return 'средно недохранване'
elif bmi <= 18.5:
return'леко недохранване'
elif bmi <= 25:
return 'нормално тегло'
elif bmi <= 30:
return 'наднормено тегло'
elif bmi <= 35:
return 'затлъстяване I степен'
elif bmi <= 40:
return 'затлъстяване II степен'
else:
return 'затлъстяване III степен'
..........
----------------------------------------------------------------------
Ran 10 tests in 0.077s

OK
Ерол Хаджи
  • Некоректно
  • 9 успешни тест(а)
  • 1 неуспешни тест(а)
Ерол Хаджи
#!/usr/bin/env python3.5
def body_mass_index(weight, height):
return weight/(height**2)
def shape_of(weight, height):
bmi = body_mass_index(weight,height)
if bmi <= 15:
return 'тежко недохранване'
elif bmi <= 16:
return 'средно недохранване'
elif bmi <= 18.5:
return 'леко недохранване'
elif bmi <= 25:
return 'нормално тегло'
elif bmi <= 30:
return 'наднормено тегло'
elif bmi <= 35:
return 'затлъстяване I степен'
elif bmi <= 40:
return 'затлъстяване II степен'
else:
'затлъстяване III степен'
.....F....
======================================================================
FAIL: test_obese_class_III (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване III степен' != None

----------------------------------------------------------------------
Ran 10 tests in 0.077s

FAILED (failures=1)
Яница Велевска
  • Некоректно
  • 1 успешни тест(а)
  • 9 неуспешни тест(а)
Яница Велевска
def body_mass_index(weight, height):
return weight / height ** 2
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
if bmi <= 15:
return "very severely underweight"
if bmi > 15 and bmi <= 16:
return "severely underweight"
if bmi > 16 and bmi <= 18.5:
return "underweight"
if bmi > 18.5 and bmi <= 25:
return "normall weight"
if bmi > 25 and bmi <= 30 :
return "overweight"
if bmi > 30 and bmi <= 35 :
return "obese class one"
if bmi > 35 and bmi <= 40 :
return "obese class two"
if bmi > 40:
return "obese class three"
.FFFFFFFFF
======================================================================
FAIL: test_edge_case (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване II степен' != 'obese class two'
- затлъстяване II степен
+ obese class two


======================================================================
FAIL: test_normal_weight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'нормално тегло' != 'normall weight'
- нормално тегло
+ normall weight


======================================================================
FAIL: test_obese_class_I (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване I степен' != 'obese class one'
- затлъстяване I степен
+ obese class one


======================================================================
FAIL: test_obese_class_II (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване II степен' != 'obese class two'
- затлъстяване II степен
+ obese class two


======================================================================
FAIL: test_obese_class_III (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване III степен' != 'obese class three'
- затлъстяване III степен
+ obese class three


======================================================================
FAIL: test_overweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'наднормено тегло' != 'overweight'
- наднормено тегло
+ overweight


======================================================================
FAIL: test_severely_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'средно недохранване' != 'severely underweight'
- средно недохранване
+ severely underweight


======================================================================
FAIL: test_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'леко недохранване' != 'underweight'
- леко недохранване
+ underweight


======================================================================
FAIL: test_very_severely_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'тежко недохранване' != 'very severely underweight'
- тежко недохранване
+ very severely underweight


----------------------------------------------------------------------
Ran 10 tests in 0.085s

FAILED (failures=9)
Деница Петрова
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Деница Петрова
def body_mass_index(weight, height):
return weight/(height**2)
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
strings = ["тежко недохранване", "средно недохранване",
"леко недохранване", "нормално тегло",
"наднормено тегло", "затлъстяване I степен",
"затлъстяване II степен", "затлъстяване III степен"]
numbers = [15, 16, 18.5, 25, 30, 35, 40]
for index, value in enumerate(numbers):
if(bmi <= value):
return strings[index]
return strings[-1]
..........
----------------------------------------------------------------------
Ran 10 tests in 0.076s

OK
Деян Боиклиев
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Деян Боиклиев
def body_mass_index(weight, height):
return weight / (height * height)
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
if bmi <= 15:
return 'тежко недохранване'
elif bmi <= 16:
return 'средно недохранване'
elif bmi <= 18.5:
return 'леко недохранване'
elif bmi <= 25:
return 'нормално тегло'
elif bmi <= 30:
return 'наднормено тегло'
elif bmi <= 35:
return 'затлъстяване I степен'
elif bmi <= 40:
return 'затлъстяване II степен'
else:
return 'затлъстяване III степен'
..........
----------------------------------------------------------------------
Ran 10 tests in 0.075s

OK
Марина Георгиева
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Марина Георгиева
def body_mass_index(weight, height):
bmi = weight / height ** 2
return round(bmi, 1)
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
if bmi <= 15:
return 'тежко недохранване'
elif bmi > 15 and bmi <= 16:
return 'средно недохранване'
elif bmi > 16 and bmi <= 18.5:
return 'леко недохранване'
elif bmi > 18.5 and bmi <= 25:
return 'нормално тегло'
elif bmi > 25 and bmi <= 30:
return 'наднормено тегло'
elif bmi > 30 and bmi <= 35:
return 'затлъстяване I степен'
elif bmi > 35 and bmi <= 40:
return 'затлъстяване II степен'
else:
return 'затлъстяване III степен'
..........
----------------------------------------------------------------------
Ran 10 tests in 0.077s

OK
Димо Дрънгов
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Димо Дрънгов
def body_mass_index(weight, height):
return weight/(height ** 2)
def shape_of(weight, height):
if weight <= 0 or height <= 0:
print('Невалидни аргументи')
return
bmi = body_mass_index(weight,height)
if bmi <= 15:
return 'тежко недохранване'
elif bmi <= 16:
return 'средно недохранване'
elif bmi <= 18.5:
return 'леко недохранване'
elif bmi <= 25:
return 'нормално тегло'
elif bmi <= 30:
return 'наднормено тегло'
elif bmi <= 35:
return'затлъстяване I степен'
elif bmi <= 40:
return 'затлъстяване II степен'
else:
return 'затлъстяване III степен'
..........
----------------------------------------------------------------------
Ran 10 tests in 0.076s

OK
Николай Бабулков
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Николай Бабулков
def body_mass_index(weight, height):
return weight / height ** 2
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
bodyWeight = []
if bmi <= 15:
bodyWeight = 'тежко недохранване'
elif bmi > 15 and bmi <= 16:
bodyWeight = 'средно недохранване'
elif bmi > 16 and bmi <= 18.5:
bodyWeight = 'леко недохранване'
elif bmi > 18.5 and bmi <= 25:
bodyWeight = 'нормално тегло'
elif bmi > 25 and bmi <= 30:
bodyWeight = 'наднормено тегло'
elif bmi > 30 and bmi <= 35:
bodyWeight = 'затлъстяване I степен'
elif bmi > 35 and bmi <= 40:
bodyWeight = 'затлъстяване II степен'
elif bmi > 40:
bodyWeight = 'затлъстяване III степен'
return bodyWeight
..........
----------------------------------------------------------------------
Ran 10 tests in 0.082s

OK
Илиан Стаменов
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Илиан Стаменов
def body_mass_index(weight, height):
return weight / (height * height)
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
indexes = [(15, "тежко недохранване"), (16, "средно недохранване"),
(18.5, "леко недохранване"), (25, "нормално тегло"),
(30, "наднормено тегло"), (35, "затлъстяване I степен"),
(40, "затлъстяване II степен")]
for index in indexes:
if bmi <= index[0]:
return index[1]
return "затлъстяване III степен"
..........
----------------------------------------------------------------------
Ran 10 tests in 0.076s

OK
Любослава Димитрова
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Любослава Димитрова
shapes_dict = {
(0, 15): 'тежко недохранване',
(15, 16): 'средно недохранване',
(16, 18.5): 'леко недохранване',
(18.5, 25): 'нормално тегло',
(25, 30): 'наднормено тегло',
(30, 35): 'затлъстяване I степен',
(35, 40): 'затлъстяване II степен',
(40, 100): 'затлъстяване III степен',
}
def body_mass_index(weight, height):
return weight / (height ** 2)
def find_range(bmi):
for key in shapes_dict.keys():
if bmi > key[0] and bmi <= key[1]:
return key
elif bmi > 100:
return (40, 100)
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
return shapes_dict[find_range(bmi)]
..........
----------------------------------------------------------------------
Ran 10 tests in 0.085s

OK
Петър Иванов
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Петър Иванов
BMI_PRECISSION = 1
def body_mass_index(weight, height):
return round(weight / height ** 2, BMI_PRECISSION)
def shape_of(weight, height):
BMI = body_mass_index(weight, height)
if BMI <= 15:
return 'тежко недохранване'
elif BMI > 15 and BMI <= 16:
return 'средно недохранване'
elif BMI > 16 and BMI <= 18.5:
return 'леко недохранване'
elif BMI > 18.5 and BMI <= 25:
return 'нормално тегло'
elif BMI > 25 and BMI <= 30:
return 'наднормено тегло'
elif BMI > 30 and BMI <= 35:
return 'затлъстяване I степен'
elif BMI > 35 and BMI <= 40:
return 'затлъстяване II степен'
else:
return 'затлъстяване III степен'
..........
----------------------------------------------------------------------
Ran 10 tests in 0.076s

OK
Славена Теодосиева
  • Некоректно
  • 1 успешни тест(а)
  • 9 неуспешни тест(а)
Славена Теодосиева
def body_mass_index(weight, height):
return weight / (height * height)
def shape_of(weight, height):
mass_index = body_mass_index(weight, height)
if mass_index <= 15:
print("tezko nedohranvane")
elif mass_index <= 16:
print("sredno nedohranvane")
elif mass_index <= 18.5:
print("leko nedohranvane")
elif mass_index <= 25:
print("normalno teglo")
elif mass_index <= 30:
print("nadnormeno teglo")
elif mass_index <= 35:
print("zatlystqvane I stepen")
elif mass_index <= 40:
print("zatlystqvane II stepen")
else:
print("zatlystqvane III stepen")
.FFFFFFFFF
======================================================================
FAIL: test_edge_case (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване II степен' != None

======================================================================
FAIL: test_normal_weight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'нормално тегло' != None

======================================================================
FAIL: test_obese_class_I (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване I степен' != None

======================================================================
FAIL: test_obese_class_II (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване II степен' != None

======================================================================
FAIL: test_obese_class_III (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'затлъстяване III степен' != None

======================================================================
FAIL: test_overweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'наднормено тегло' != None

======================================================================
FAIL: test_severely_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'средно недохранване' != None

======================================================================
FAIL: test_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'леко недохранване' != None

======================================================================
FAIL: test_very_severely_underweight (test.TestBodyMassIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/rails/pyfmi-2016/releases/20160307095126/lib/language/python/runner.py", line 67, in thread
    raise result
AssertionError: 'тежко недохранване' != None

----------------------------------------------------------------------
Ran 10 tests in 0.096s

FAILED (failures=9)
Йоан Динков
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Йоан Динков
def body_mass_index(weight, height):
return round(weight / (height ** 2), 1)
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
if bmi <= 15: return 'тежко недохранване'
if bmi <= 16: return 'средно недохранване'
if bmi <= 18.5: return 'леко недохранване'
if bmi <= 25: return 'нормално тегло'
if bmi <= 30: return 'наднормено тегло'
if bmi <= 35: return 'затлъстяване I степен'
if bmi <= 40: return 'затлъстяване II степен'
return 'затлъстяване III степен'
..........
----------------------------------------------------------------------
Ran 10 tests in 0.097s

OK
Христо Владев
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Христо Владев
CATEGORIES = {
'тежко недохранване': (float('-inf'), 15),
'средно недохранване': (15, 16),
'леко недохранване': (16, 18.5),
'нормално тегло': (18.5, 25),
'наднормено тегло': (25, 30),
'затлъстяване I степен': (30, 35),
'затлъстяване II степен': (35, 40),
'затлъстяване III степен': (40, float('inf')),
}
def body_mass_index(weight, height):
return round(weight / height**2, 1)
def shape_of(weight, height):
for category, interval in CATEGORIES.items():
if interval[0] < body_mass_index(weight, height) <= interval[1]:
return category
..........
----------------------------------------------------------------------
Ran 10 tests in 0.076s

OK
Симеон Ролев
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Симеон Ролев
def body_mass_index(weight, height):
return weight/height**2
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
if bmi <= 15:
return 'тежко недохранване'
elif bmi > 15 and bmi <= 16:
return 'средно недохранване'
elif bmi > 16 and bmi <= 18.5:
return 'леко недохранване'
elif bmi > 18.5 and bmi <= 25:
return 'нормално тегло'
elif bmi > 25 and bmi <= 30:
return 'наднормено тегло'
elif bmi > 30 and bmi <= 35:
return 'затлъстяване I степен'
elif bmi > 35 and bmi <= 40:
return 'затлъстяване II степен'
elif bmi > 40:
return 'затлъстяване III степен'
if __name__ == '__main__':
my_bmi = body_mass_index(64,1.75)
print(my_bmi)
print(shape_of(64,1.75))
..........
----------------------------------------------------------------------
Ran 10 tests in 0.075s

OK
Хризантема Станчева
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Хризантема Станчева
def body_mass_index(weight, height):
return weight/(height**2)
def shape_of(weight, height):
bmi = body_mass_index(weight, height)
if bmi <= 15:
return 'тежко недохранване'
elif bmi > 15 and bmi <= 16:
return 'средно недохранване'
elif bmi > 16 and bmi <= 18.5:
return 'леко недохранване'
elif bmi > 18.5 and bmi <= 25:
return 'нормално тегло'
elif bmi > 25 and bmi <= 30:
return 'наднормено тегло'
elif bmi > 30 and bmi <= 35:
return 'затлъстяване I степен'
elif bmi > 35 and bmi <= 40:
return 'затлъстяване II степен'
else:
return 'затлъстяване III степен'
..........
----------------------------------------------------------------------
Ran 10 tests in 0.076s

OK
Пламен Начев
  • Коректно
  • 10 успешни тест(а)
  • 0 неуспешни тест(а)
Пламен Начев
def body_mass_index(weight, height):
return weight/(height*height)
def shape_of(weight, height):
BMI = body_mass_index(weight, height)
if BMI <= 15:
return 'тежко недохранване'
elif BMI > 15 and BMI <= 16:
return 'средно недохранване'
elif BMI > 16 and BMI <= 18.5:
return 'леко недохранване'
elif BMI > 18.5 and BMI <= 25:
return 'нормално тегло'
elif BMI > 25 and BMI <= 30:
return 'наднормено тегло'
elif BMI > 30 and BMI <= 35:
return 'затлъстяване I степен'
elif BMI > 35 and BMI <= 40:
return 'затлъстяване II степен'
else:
return 'затлъстяване III степен'
..........
----------------------------------------------------------------------
Ran 10 tests in 0.081s

OK