Skip to content
Advertisement

How may I define more option in my question?

JavaScript

I made this cause my question contains 8 answers but in output, it prints both “correct +20 Score” and “incorrect +0 Score”. I want to fix it Please help me.

Advertisement

Answer

You need to use else statements when comparing, not multiple ifs. If you need multiple ifs you should use elif.

https://www.tutorialspoint.com/python/python_if_else.htm

However, it would be much more clear and concise to store your answers in a list and check if the users response exists in the list, else no score.

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement