Skip to content

Commit

Permalink
added consistency and updated the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Manan Patel committed Oct 29, 2019
1 parent 7cdb249 commit 6c7dcff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Binary file added .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A simple quiz game built using Python
(b) Exit.

4. Pick your interest
(a) Science (b) History of India (c) Commerce (d)Technology (e)World GK
(1) Science (2) History of India (3) Commerce (4)Technology (5)World GK

You'll be presented with domain specific questions.

Expand Down
6 changes: 3 additions & 3 deletions question.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def ask_one_question(question):
print("\n" + question)
choice = input("Enter Choice [a/b/c/d]: ")
choice = input("Enter Your Choice [a/b/c/d]: ")
while(True):
if choice.lower() in ['a', 'b', 'c', 'd']:
return choice
Expand All @@ -29,7 +29,7 @@ def score_one_result(key, meta):

def test(questions):
score = 0
print("General Instructions:\n1. Please enter only the choice number corresponding to the correct answer.\n2. Each question carries 2 points\n3. Wrong answer leads to -1 marks per question\nGood Luck!\n")
print("General Instructions:\n1. Please enter only the choice letter corresponding to the correct answer.\n2. Each question carries 2 points\n3. Wrong answer leads to -1 marks per question\nQuiz will start momentarily. Good Luck!\n")
time.sleep(10)
for key, meta in questions.items():
questions[key]["user_response"] = ask_one_question(meta["question"])
Expand All @@ -51,7 +51,7 @@ def load_question(filename):
def play_quiz():
flag = False
try:
choice = int(input("Welcome to Today's Quiz!\nChoose your domain of interest:\n(1). Science\n(2). History of India\n(3). Commerce\n(4). Technology\n(5). World Gk\n Enter your choice: "))
choice = int(input("Welcome to Today's Quiz!\nChoose your domain of interest:\n(1). Science\n(2). History of India\n(3). Commerce\n(4). Technology\n(5). World Gk\nEnter Your Choice [1/2/3/4/5]: "))
if choice > len(TOPICS_LIST) or choice < 1:
print("Invalid Choice. Enter Again")
flag = True # raising flag
Expand Down

0 comments on commit 6c7dcff

Please sign in to comment.