{"id":109,"date":"2026-02-13T15:52:43","date_gmt":"2026-02-13T15:52:43","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/d_harkless\/?p=109"},"modified":"2026-02-13T15:52:43","modified_gmt":"2026-02-13T15:52:43","slug":"free-friday-2-13-26","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/d_harkless\/2026\/02\/13\/free-friday-2-13-26\/","title":{"rendered":"Free Friday 2\/13\/26"},"content":{"rendered":"\n<p>Today in class, I made a quiz game. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"342\" height=\"112\" src=\"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-content\/uploads\/2026\/02\/image-3.png\" alt=\"\" class=\"wp-image-113\" srcset=\"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-content\/uploads\/2026\/02\/image-3.png 342w, https:\/\/theroyalscode.com\/students\/d_harkless\/wp-content\/uploads\/2026\/02\/image-3-300x98.png 300w\" sizes=\"auto, (max-width: 342px) 100vw, 342px\" \/><\/figure>\n\n\n\n<p>These are the questions I used and the options:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>questions = (\"How many elements are in the periodic table?: \",\n              \"Which animal lays the largest eggs?: \",\n               \"What is the most abundant gas in Earth's atmosphere?: \",\n               \"How many bones are in the human body?: \",\n               \"Which planet in the solar system is the hottest?: \")\n\noptions = ((\"A. 116\", \"B. 117\", \"C. 118\", \"D. 119\"),\n           (\"A. Whale\", \"B. Crocodile\", \"C. Elephant\", \"D. Ostrich\"),\n           (\"A. Nitrogen\", \"B. Oxygen\", \"C. Carbon-Dioxide\", \"D. Hydrogen\"),\n           (\"A. 206\", \"B. 207\", \"C. 208\", \"D. 209\"),\n           (\"A. Mercury\", \"B. Venus\", \"C. Earth\", \"D. Mars\"))<\/code><\/pre>\n\n\n\n<p>This is the code that calculates the score:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>score = int(score \/ len(questions) * 100)\nprint(f\"Your score is: {score}%\")<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"228\" height=\"106\" src=\"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-content\/uploads\/2026\/02\/image-2.png\" alt=\"\" class=\"wp-image-112\" style=\"aspect-ratio:2.1511879049676024;width:270px;height:auto\"\/><\/figure>\n\n\n\n<p>This is the code that prints the questions and options and asks the player to choose an option.  It also checks if the answer the player chose is correct or incorrect, and if the answer is incorrect it tells them the right answer. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>for question in questions:\n    print(\"----------------------\")\n    print(question)\n    for option in options&#91;question_num]:\n        print(option)\n\n    guess = input(\"Enter (A, B, C, D): \").upper()\n    guesses.append(guess)\n    if guess == answers&#91;question_num]:\n        score += 1\n        print(\"CORRECT!\")\n    else:\n        print(\"INCORRECT!\")\n        print(f\"{answers&#91;question_num]} is the correct answer\")\n    question_num += 1<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"391\" height=\"134\" src=\"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-content\/uploads\/2026\/02\/image.png\" alt=\"\" class=\"wp-image-110\" style=\"width:273px;height:auto\" srcset=\"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-content\/uploads\/2026\/02\/image.png 391w, https:\/\/theroyalscode.com\/students\/d_harkless\/wp-content\/uploads\/2026\/02\/image-300x103.png 300w\" sizes=\"auto, (max-width: 391px) 100vw, 391px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"372\" height=\"137\" src=\"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-content\/uploads\/2026\/02\/image-1.png\" alt=\"\" class=\"wp-image-111\" style=\"width:269px;height:auto\" srcset=\"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-content\/uploads\/2026\/02\/image-1.png 372w, https:\/\/theroyalscode.com\/students\/d_harkless\/wp-content\/uploads\/2026\/02\/image-1-300x110.png 300w\" sizes=\"auto, (max-width: 372px) 100vw, 372px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"623\" height=\"600\" src=\"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-content\/uploads\/2026\/02\/image-4.png\" alt=\"\" class=\"wp-image-114\" style=\"aspect-ratio:1.0383379738702077;width:588px;height:auto\" srcset=\"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-content\/uploads\/2026\/02\/image-4.png 623w, https:\/\/theroyalscode.com\/students\/d_harkless\/wp-content\/uploads\/2026\/02\/image-4-300x289.png 300w\" sizes=\"auto, (max-width: 623px) 100vw, 623px\" \/><\/figure>\n\n\n\n<p>Link:<a href=\"https:\/\/www.youtube.com\/watch?v=zehwgTB0vV8\">https:\/\/www.youtube.com\/watch?v=zehwgTB0vV8<\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today in class, I made a quiz game. These are the questions I used and the options: This is the code that calculates the score: This is the code that prints the questions and options and asks the player to choose an option. It also checks if the answer the player chose is correct or [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-109","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-json\/wp\/v2\/posts\/109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-json\/wp\/v2\/comments?post=109"}],"version-history":[{"count":1,"href":"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-json\/wp\/v2\/posts\/109\/revisions"}],"predecessor-version":[{"id":115,"href":"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-json\/wp\/v2\/posts\/109\/revisions\/115"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-json\/wp\/v2\/media?parent=109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-json\/wp\/v2\/categories?post=109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-json\/wp\/v2\/tags?post=109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}