#------start
print('-------------------------------------------- \\n')
print('Welcome!')
print('This is a quiz game')
q_no = 0
score = 0
wanna_play = input('Do you want to play the qiuz? (y or n) : ').lower()
print(wanna_play)
if wanna_play == 'y':
print('Okay! :)\\n')
elif wanna_play == 'n':
print('Quiz will be quit.')
print('\\n--------------------------------------------')
quit()
else:
print('--------------------------------------------')
quit()
rules = ('Note : the spellings and the spacings of the answers should be correct. \\n')
print(rules)
#-------q1
q1 = input('What does "IT" stands for : ').lower()
if q1 == ('information technology'):
q_no += 1
score += 1
print('Hurray!')
print(f'you completed {q_no} question and got {score}')
else:
print('The correct answer is "Information Technology" ')
q_no += 1
print(f'you completed {q_no} question and got {score}')
print()
#-------q2
q2 = input('What does "HTML" stands for : ').lower()
if q2 == ('hyper text markup language'):
q_no += 1
score += 1
print('Hurray!')
print(f'you completed {q_no} question and got {score}')
else:
print('The correct answer is "Hyper Text Markup Language" ')
q_no += 1
print(f'you completed {q_no} question and got {score}')
print()
#-------q3
q3 = input('What does "GPU" stands for : ').lower()
if q3 == ('graphical processing unit'):
q_no += 1
score += 1
print('Hurray!')
print(f'you completed {q_no} question and got {score}')
else:
print('The correct answer is "Graphical Processing Unit" ')
q_no += 1
print(f'you completed {q_no} question and got {score}')
print()
#-------q4
q4 = input('What does "RAM and ROM" stands for : (separate answer by ", ") ').lower()
if q4 == ('random access memory, read only memory'):
q_no += 1
score += 1
print('Hurray!')
print(f'you completed {q_no} question and got {score}')
else:
print('The correct answer is "random access memory, read only memory" ')
q_no += 1
print(f'you completed {q_no} question and got {score}')
print()
#-------q5
q5 = input('What does "PHP stands for? ').lower()
if q5 == ("hyper text preprocessor"):
q_no += 1
score += 1
print('Hurray!')
print(f'you completed {q_no} question and got {score}')
else:
print('The correct answer is "hyper text preprocessor" ')
q_no += 1
print(f'You completed {q_no} question and got {score}')
#-------total
print(f'\\nNumber of question completed is {q_no}')
print(f"Your score is {score} / 5 !!!")
try:
percentage = (score *100) / q_no
except ZeroDivisionError:
print("you're average is 0%.")
print(f"You're average is {percentage}%.")
print('\\n--------------------------------------------')
prints,
Welcome! This is a quiz game Do you want to play the qiuz? (y or n) : y y Okay!
Note : the spellings and the spacing of the answers should be correct.
What does "IT" stands for : Information technology Hurray! you completed 1 question and got 1
What does "HTML" stands for : Hyper text markup language Hurray! you completed 2 question and got 2
What does "GPU" stands for : graphical processing unit Hurray! you completed 3 question and got 3
What does "RAM and ROM" stands for : (separate answer by ", ") ram, rom The correct answer is "random access memory, read only memory" you completed 4 question and got 3
What does "PHP stands for? hyper text preprocessor The correct answer is "hypertext preprocessor" you completed 5 question and got 3
number of question completed is 5 your score is 3 !!! 60.0% questions are correct.