Your error suggests that, when you check the test case for the correct answer '"A"', it is not returning the result as expected.
Your issue is that in the 'test_response' function, when the correct answer is provided '"A"', your assertion is failing. The code below should be correct, assuming that the correct variable is indeed set to '"A"' before running your test case.
Also double-check that the correct variable is set correctly and that there are no typos. You may also want to print the value of 'response("A")' to see what it is returning and debug from there -
def response(res):
global score, correct
res = res.upper()
if res == correct:
score = score + 1
return "Correct Answer!"
else:
print("Wrong Answer :(")
return "Correct Answer: {}".format(correct)
def test_response():
global correct
global score
correct = "A"
score = 0
assert response("A") == "Correct Answer!"
assert score == 1
score = 0
assert response("wrong") == "Correct Answer: {}".format(correct)
assert score == 0