{"id":144,"date":"2026-03-27T13:40:36","date_gmt":"2026-03-27T13:40:36","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/d_harkless\/?p=144"},"modified":"2026-03-27T13:40:36","modified_gmt":"2026-03-27T13:40:36","slug":"free-friday-3-27-26","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/d_harkless\/2026\/03\/27\/free-friday-3-27-26\/","title":{"rendered":"Free Friday 3\/27\/26"},"content":{"rendered":"\n<p>Today in class, I made a number guessing game.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"335\" height=\"359\" src=\"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-content\/uploads\/2026\/03\/image-6.png\" alt=\"\" class=\"wp-image-145\" style=\"width:311px;height:auto\" srcset=\"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-content\/uploads\/2026\/03\/image-6.png 335w, https:\/\/theroyalscode.com\/students\/d_harkless\/wp-content\/uploads\/2026\/03\/image-6-280x300.png 280w\" sizes=\"auto, (max-width: 335px) 100vw, 335px\" \/><\/figure>\n\n\n\n<p>This is the code that determines whether the users guess was too high, too low, or correct. It also tells the user how many guesses it took.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if guess &lt; lowest_num or guess > highest_num:\n            print(\"That number is out of range\")\n            print(f\"Select a number between {lowest_num} and {highest_num}\")\n        elif guess &lt; answer:\n            print(\"Too low! Try again\")\n        elif guess > answer:\n            print(\"Too high! Try again\")\n        else:\n            print(f\"CORRECT! The answer was {answer}\")\n            print(f\"Number of guesses: {guesses}\") \n            is_running = False   \n<\/code><\/pre>\n\n\n\n<p>This is the code for when the user enters something invalid.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>else:\n        print(\"Invalid guess\")\n        print(f\"Select a number between {lowest_num} and {highest_num}\")<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"630\" height=\"761\" src=\"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-content\/uploads\/2026\/03\/image-7.png\" alt=\"\" class=\"wp-image-146\" style=\"width:448px;height:auto\" srcset=\"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-content\/uploads\/2026\/03\/image-7.png 630w, https:\/\/theroyalscode.com\/students\/d_harkless\/wp-content\/uploads\/2026\/03\/image-7-248x300.png 248w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Today in class, I made a number guessing game. This is the code that determines whether the users guess was too high, too low, or correct. It also tells the user how many guesses it took. This is the code for when the user enters something invalid.<\/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-144","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-json\/wp\/v2\/posts\/144","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=144"}],"version-history":[{"count":1,"href":"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-json\/wp\/v2\/posts\/144\/revisions"}],"predecessor-version":[{"id":147,"href":"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-json\/wp\/v2\/posts\/144\/revisions\/147"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-json\/wp\/v2\/media?parent=144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-json\/wp\/v2\/categories?post=144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/d_harkless\/wp-json\/wp\/v2\/tags?post=144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}