# Functions go here #Check that users have entered a valid option based on a list def answer_compare(user, answer): # If the user and the actual answer is the same, it's correct if user == answer: result = "correct" # If it's not correct, then it's incorrect else: result = "incorrect" return result # Automated testing is below in the form (test_case, expected_value) to_test = [ ("4", '4', 'correct'), ('6', '8', 'incorrect'), ('42', '21', 'incorrect'), ('3', '5', 'incorrect'), ('60', '60', 'correct'), ('24', '30', 'incorrect'), ('99', '90', 'incorrect'), ('45', '48', 'incorrect'), ('72', '72', 'correct'), ] # run tests! for item in to_test: # retrieve test case and expected value user = item[0] answer = item[1] expected = item[2] # get actual value (ie: test ticket function) actual = answer_compare(user, answer) # compare actual and expected and output pass / fail if actual == expected: print(f" Passed! Case: {user} vs {answer}, expected: {expected}, received: {actual}") else: print(f" Failed! Case: {user} vs {answer}, expected: {expected}, received: {actual}")