Create a QUIZ GAME with Python 💯
Bro Code
View ChannelAbout
Coding bootcamps HATE HIM! 🗿
Latest Posts
Video Description
#python #tutorial #course # Python quiz game questions = ("How many elements are in the periodic table?: ", "Which animal lays the largest eggs?: ", "What is the most abundant gas in Earth's atmosphere?: ", "How many bones are in the human body?: ", "Which planet in the solar system is the hottest?: ") options = (("A. 116", "B. 117", "C. 118", "D. 119"), ("A. Whale", "B. Crocodile", "C. Elephant", "D. Ostrich"), ("A. Nitrogen", "B. Oxygen", "C. Carbon-Dioxide", "D. Hydrogen"), ("A. 206", "B. 207", "C. 208", "D. 209"), ("A. Mercury", "B. Venus", "C. Earth", "D. Mars")) answers = ("C", "D", "A", "A", "B") guesses = [] score = 0 question_num = 0 for question in questions: print("----------------------") print(question) for option in options[question_num]: print(option) guess = input("Enter (A, B, C, D): ").upper() guesses.append(guess) if guess == answers[question_num]: score += 1 print("CORRECT!") else: print("INCORRECT!") print(f"{answers[question_num]} is the correct answer") question_num += 1 print("----------------------") print(" RESULTS ") print("----------------------") print("answers: ", end="") for answer in answers: print(answer, end=" ") print() print("guesses: ", end="") for guess in guesses: print(guess, end=" ") print() score = int(score / len(questions) * 100) print(f"Your score is: {score}%")
Craft Engaging Quizzes Today
AI-recommended products based on this video

Freenove Ultimate Starter Kit for BBC micro bit (V2 Included), 316-Page Detailed Tutorial, 225 Items, 44 Projects, Blocks and Python Code

Freenove Ultimate Starter Kit for BBC micro bit (V2 Included), 316-Page Detailed Tutorial, 225 Items, 44 Projects, Blocks and Python Code

10.1 Inch Touch Portable Monitor IPS Screen 1366x768P 60Hz 400 Brightness 99% sRGB HDMI USB-C Monitors Switch for Xbox PS3/4/5 Laptop Compatible with Raspberry Pi, Mini Touch Screen

Freenove Ultimate Starter Kit for BBC micro bit (V2 Included), 316-Page Detailed Tutorial, 225 Items, 44 Projects, Blocks and Python Code

Freenove Ultimate Starter Kit for BBC micro bit (V2 Included), 316-Page Detailed Tutorial, 225 Items, 44 Projects, Blocks and Python Code

