{"id":107,"date":"2026-01-16T15:16:42","date_gmt":"2026-01-16T15:16:42","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/l_rankins\/?p=107"},"modified":"2026-01-16T15:16:42","modified_gmt":"2026-01-16T15:16:42","slug":"bleeg-18-magness","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/l_rankins\/2026\/01\/16\/bleeg-18-magness\/","title":{"rendered":"BLEEG 18: MAGNESS"},"content":{"rendered":"\n<p><strong>Today I made a quiz game.<\/strong><\/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><strong>This is the code that selects questions and the answer choices for them.<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>answers = (\"C\", \"D\", \"A\", \"A\", \"B\")\nguesses = &#91;]\nscore = 0\nquestion_num = 0<\/code><\/pre>\n\n\n\n<p><strong>This is the code for the answers, guessed, score, and question number.<\/strong><\/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<p><strong>This prints the Questions and then the Options and decides if its wrong or right.<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>print(\"----------------------\")\nprint(\"       RESULTS        \")\nprint(\"----------------------\")\n\nprint(\"answers: \", end=\"\")\nfor answer in answers:\n    print(answer, end=\" \")\nprint()\n\nprint(\"guesses: \", end=\"\")\nfor guess in guesses:\n    print(guess, end=\" \")\nprint()\n\nscore = int(score \/ len(questions) * 100)\nprint(f\"Your score is: {score}%\")<\/code><\/pre>\n\n\n\n<p><strong>This prints the Results and the score.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I made a quiz game. This is the code that selects questions and the answer choices for them. This [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-107","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/l_rankins\/wp-json\/wp\/v2\/posts\/107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/l_rankins\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/l_rankins\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/l_rankins\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/l_rankins\/wp-json\/wp\/v2\/comments?post=107"}],"version-history":[{"count":1,"href":"https:\/\/theroyalscode.com\/students\/l_rankins\/wp-json\/wp\/v2\/posts\/107\/revisions"}],"predecessor-version":[{"id":112,"href":"https:\/\/theroyalscode.com\/students\/l_rankins\/wp-json\/wp\/v2\/posts\/107\/revisions\/112"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/l_rankins\/wp-json\/wp\/v2\/media?parent=107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/l_rankins\/wp-json\/wp\/v2\/categories?post=107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/l_rankins\/wp-json\/wp\/v2\/tags?post=107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}