‘’‘Write a simple quiz game that has a list of ten questions and a list of answers to those questions.
The game should give the player four randomly selected questions to answer. It should
ask the questions one-by-one, and tell the player whether they got the question right or
wrong. At the end it should print out how many out of four they got right.’’’
from random import *
Questions=
[
'What is the capital of the United States of America? ',
'Who is the current president of the United States of America? ',
'What is the capital of Nigeria? ',
'Muhammadu Buhari is the president of which country? ',
'Uhuru Kenyatta is the president of which country? ',
'What is the capital of France? ',
'Which state has only one neighbor? ',
'Where is Amsterdam located? ',
'Emmanuel Macron is the president of which country? ',
'Sir Alex Ferguson until his retirement coached which team? ’
]
Answers=[ ‘Washington DC’,
‘President Donald Trump’,
‘Abuja’
‘Nigeria’,
‘Kenya’,
‘Paris’,
‘Maine’,
‘Netherland’,
‘France’,
‘Manchester United’
]
num_right= 0
s = sample(Questions, 4)
for i in range(len(s)):
answer= input(Questions[i])
if answer.lower()==Answers[i].lower():
print(‘Correct!!!’)
num_right+=1
else:
print('Not correct ')