{"id":236,"date":"2025-05-25T19:16:41","date_gmt":"2025-05-25T19:16:41","guid":{"rendered":"https:\/\/r0b3rt.com\/andr-web\/?p=236"},"modified":"2025-05-25T19:17:12","modified_gmt":"2025-05-25T19:17:12","slug":"python-hurkle","status":"publish","type":"post","link":"http:\/\/r0b3rt.com\/andr-web\/python-hurkle\/","title":{"rendered":"Python &#8211; Hurkle"},"content":{"rendered":"<p><a href=\"https:\/\/www.essentialwidgets.com\/programs\/hurkle.html\">HTML Hurkle<\/a><\/p>\n<pre>\r\nimport random\r\nsecret_number = random.randint(1, 99)\r\n\r\nimport sys\r\n\r\nprint(\r\n\"\"\"\r\n+============================+\r\n| Welcome to Robert's Hurkle.|\r\n| Guess the Secret Number.   |\r\n+============================+\r\n\"\"\")\r\nprint (\"The Secret Number is \" + str(secret_number))\r\n\r\nMyGuess = 0\r\nguesses = 0\r\n\r\nwhile MyGuess != secret_number:\r\n    MyGuess = int(input(\"Enter your secret number guess:  \"))\r\n    if MyGuess > secret_number: hint=\"Lower\"\r\n    else: hint= \"Higher\"\r\n    \r\n    if MyGuess == secret_number:\r\n        print (\"Congratulations.  You guessed correctly.\")\r\n        print (\"The number is \" + str(MyGuess))\r\n        print (\"it took you \" + str(guesses+1) + \" guesses to get it right.\")\r\n        print()\r\n    elif MyGuess == 0:\r\n        print (\"The number was \" + str(secret_number) + \".\")\r\n        sys.exit()\r\n    else:\r\n        print (\"Wrong.  \" + str(MyGuess) + \" is not the number.\")\r\n        print (\"Enter ZERO to give up.\")\r\n        guesses += 1\r\n        print (\"So far, you guessed \" + str(guesses) + \" times.\")\r\n        print (\"The secret number is \" + hint)\r\n        print()\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>HTML Hurkle import random secret_number = random.randint(1, 99) import sys print( &#8220;&#8221;&#8221; +============================+ | Welcome to Robert&#8217;s Hurkle.| | Guess the Secret Number. | +============================+ &#8220;&#8221;&#8221;) print (&#8220;The Secret Number is &#8221; + str(secret_number)) MyGuess = 0 guesses = 0 while MyGuess != secret_number: MyGuess = int(input(&#8220;Enter your secret number guess: &#8220;)) if MyGuess > &hellip; <a href=\"http:\/\/r0b3rt.com\/andr-web\/python-hurkle\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Python &#8211; Hurkle&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-236","post","type-post","status-publish","format-standard","hentry","category-writing-code"],"_links":{"self":[{"href":"http:\/\/r0b3rt.com\/andr-web\/wp-json\/wp\/v2\/posts\/236","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/r0b3rt.com\/andr-web\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/r0b3rt.com\/andr-web\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/r0b3rt.com\/andr-web\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/r0b3rt.com\/andr-web\/wp-json\/wp\/v2\/comments?post=236"}],"version-history":[{"count":1,"href":"http:\/\/r0b3rt.com\/andr-web\/wp-json\/wp\/v2\/posts\/236\/revisions"}],"predecessor-version":[{"id":237,"href":"http:\/\/r0b3rt.com\/andr-web\/wp-json\/wp\/v2\/posts\/236\/revisions\/237"}],"wp:attachment":[{"href":"http:\/\/r0b3rt.com\/andr-web\/wp-json\/wp\/v2\/media?parent=236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/r0b3rt.com\/andr-web\/wp-json\/wp\/v2\/categories?post=236"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/r0b3rt.com\/andr-web\/wp-json\/wp\/v2\/tags?post=236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}