It is because you typed wrong statement when want to increment q by 1.
You typed: q=+1 three times, but it have to be q+=1 instead.
With your code, q could be 3 times assigned as +1, and later when you calculate result you get
result = 1/3 if one or all correct answers.
Also, if you want result to be like 33%, 66%.. you should multiply actual result with 100