MCPcopy Create free account
hub / github.com/Mrinank-Bhowmick/python-beginner-projects / main

Function main

projects/Online Trivia/main.py:39–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37
38
39def main():
40 quiz_data = fetch_quiz_data()
41 score = 0
42 question_number = 0
43
44 for question in quiz_data:
45 question_number += 1
46
47 display_question(question, question_number, score)
48
49 answer = input("Enter Answer (To skip type 'skip'): ")
50 print("\n" * 10)
51
52 if answer == "skip":
53 continue
54
55 if check_answer(question, answer, score):
56 score += 1
57 print("Wait moving to the next question...")
58 sleep(6)
59 else:
60 score -= 1
61 print("Point deducted...")
62 print("Wait moving to the next question...")
63 sleep(6)
64
65 print("\n" * 10)
66 print("Your final score is", score, "!")
67 print("Thanks for playing! 💜")
68
69
70if __name__ == "__main__":

Callers 1

main.pyFile · 0.70

Calls 3

fetch_quiz_dataFunction · 0.85
display_questionFunction · 0.85
check_answerFunction · 0.85

Tested by

no test coverage detected