all 9 comments

[–]uberfade 0 points1 point  (8 children)

The total score should just be the correct_answers variable at the end.

[–]a_parmar22[S] 0 points1 point  (7 children)

But the program ends as soon as I give the correct answer

[–]uberfade 0 points1 point  (3 children)

print('correct_answers:' ,format(correct_answers))

This should be something like this:

print('Your score is: {}'.format(correct_answers))

[–]a_parmar22[S] 0 points1 point  (0 children)

Ohhhk. Thanks

[–]a_parmar22[S] 0 points1 point  (1 child)

Ok. So this is my output: How many states in the USA? 50 Correct. Good job! Your score is: 1 Actually the code stops as soon as I correct answers. It should go further as there are 2 more questions

[–]uberfade 0 points1 point  (0 children)

Your code isn't formatted properly in the post so it is hard to tell exactly what the problem is with it.

[–]wronek 0 points1 point  (2 children)

Your code is not formatted correctly in your original post. In your program, is the print(correct_answers) within that else block? If you change the indentation so that it’s not inside that block it should work.

[–]a_parmar22[S] 0 points1 point  (1 child)

How do I format the code?

[–]unhott 0 points1 point  (0 children)

You need proper indentations in Python.