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.
neighbouring = ['pakistan', 'china', 'nepal', 'bhutan', 'bangladesh', 'myanmar', 'sri lanka', 'maldivs']
a1=str(input("4.Name one neighbouring country of India."))
if a1.lower() in neighbouring:
print('correct 20 score')
score += 20
else:
print('incorrect')
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…