Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QUIZ APP #245

Closed
Kaushik-Parasa opened this issue Mar 26, 2024 · 0 comments
Closed

QUIZ APP #245

Kaushik-Parasa opened this issue Mar 26, 2024 · 0 comments

Comments

@Kaushik-Parasa
Copy link

print("Wellcome to quiz game !!")
print('NOTE: if your spelling is incorrect then it is considered as wrong answer')
score = 0
question_no = 0
playing = input('Do you want to play ? ').lower()
if playing == 'yes':
question_no += 1
ques = input(f'\n{question_no}. what does CPU stand for? ').lower()
if ques == 'central processing unit':
score +=1
print('correct! you got 1 point')

else:
    print('Incorrect!')
    print(f'current answer is --> central processing unit')

------1

question_no += 1
ques = input(f'\n{question_no}. what does GPU stand for? ').lower()

if ques == 'graphics processing unit':
    score +=1
    print('correct! you got 1 point')
    
else:
    print('Incorrect!')
    print(f'current answer is --> graphics processing unit')

-----2

question_no += 1
ques = input(f'\n{question_no}. what does RAM stand for? ').lower()

if ques == 'random access memory':
    score +=1
    print('correct! you got 1 point')
    
else:
    print('Incorrect!')
    print(f'current answer is --> random access memory')

-----3

question_no += 1
ques = input(f'\n{question_no}. what does PSU stand for? ').lower()

if ques == 'power supply unit':
    score +=1
    print('correct! you got 1 point')
    
else:
    print('Incorrect!')
    print(f'current answer is --> power supply unit')

-----4

question_no += 1
ques = input(f'\n{question_no}. what does ROM stand for? ').lower()

if ques == 'read only memory':
    score +=1
    print('correct! you got 1 point')
    
else:
    print('Incorrect!')
    print(f'current answer is --> read only memory')

------5

else:
print('thankyou you are out of a game.')
quit()

print(f'\nnumber of question is {question_no}')
print(f'your score is {score}')
try:
percentage = (score *100)/question_no
except ZeroDivisionError:
print('0% quetions are correct')

print(f'{percentage}% questions are correct.')

@ndleah ndleah closed this as completed Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants