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.py #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions quiz.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
print('WELCOME TO THE QUIZ')
answer=input('Are you ready to play the Quiz ? (yes/no) :\n')
score=0
total_questions=3

if answer.lower()=='yes':
answer=input('Question 1: what is the national game of India ?\n')
if answer.lower()=='hockey':
score += 1
print('Nice')
else:
print('OOPS Wrong Answer :( try again')

answer=input('Question 2: ? How many centuries does Sachin Tendulkar has in international cricket? \n')
if answer.lower()=='100':
score += 1
print('Wow keep going')
else:print('Wrong Answer :(')

answer=input('Question 3:In which year India won its first World Cup ?\n')
if answer.lower()=='1983':
score += 1
print('Excellent Work')
else:
print('Wrong Answer :(')

print('Thankyou for Playing quiz , you attempted',score,"questions correctly!")
mark=(score/total_questions)*100
print('Marks obtained:',mark)