0

I am creating a function in python that identifies whether an ingredient is on a menu, the menu is inputted as strings. It has to pass the test code given below and although it is outputting the correct boolean the test is saying 'Failure'? Here is my python function

def free_from(test_menu: str, str):
    if str in test_menu:
        print(False)
    else:
        print(True)

This is the test it has to pass

test_menu = [ ['potato'],
              ['cheese'],
              ['apple'] ]
expected_result = True
if free_from(test_menu, 'water') == expected_result:
    print('Working')
else:
    print('Failure')

It is outputting True Failure

0 Answers0