I'm taking this programming class and one of our assignments is to make a quiz and return right and wrong answers. So I've coded it all and the only thing that seems to be wrong is my passing of arguments. My result is always zero I'd appreciate any help given.
Here is my code:
correctAnswers = 0
wrongAnswers = 0
answer = input("Question 1: 5-3")
if(answer == 2):
correctAnswers + 1
else:
wrongAnswers +1
grade(correctAnswers, wrongAnswers)
grade(right, wrong):
right - wrong
print("You have a total of " + str(right) + " correct answers")
It's just a snippet of it, but gets the idea across.
correctAnswersorwrongAnswersnor stores the value thatright - wrongevaluates to.right - wrongsupposed to do? You're doing subtraction, but not saving the result anywhere.