{"id":275,"date":"2023-06-24T20:39:23","date_gmt":"2023-06-24T20:39:23","guid":{"rendered":"https:\/\/joseph-t-gordon.tech\/?p=275"},"modified":"2023-06-26T14:25:48","modified_gmt":"2023-06-26T14:25:48","slug":"post-53-errors-playing-hard-to-get","status":"publish","type":"post","link":"https:\/\/joseph-t-gordon.tech\/index.php\/2023\/06\/24\/post-53-errors-playing-hard-to-get\/","title":{"rendered":"Post #53 (Python Programming) &#8211; Errors playing hard to get"},"content":{"rendered":"\n<p>As I&#8217;ve mentioned in some of my previous posts python is an interpreted language, meaning it&#8217;s parsed as it is being executed. This can lead to an interesting issue, look at the following code.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Ex:<\/p>\n\n\n\n<p>Temp = int(input(&#8220;Enter the temperature in celsius: &#8220;))<\/p>\n\n\n\n<p>if Temp &lt;= 0:<\/p>\n\n\n\n<p>    print(&#8220;Might want to wear a coat&#8221;)<\/p>\n\n\n\n<p>else:<\/p>\n\n\n\n<p>    prin(&#8220;At least it isn&#8217;t below freezing&#8221;)<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>You can probably see the error right away it&#8217;s the prin, however if you run this Python will not detect anything right away and if you don&#8217;t enter a value greater than 0 it will not return any error. It will only see that error if that execution path is ran. This is why it&#8217;s important to check every execution path and debug your code. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As I&#8217;ve mentioned in some of my previous posts python is an interpreted language, meaning it&#8217;s parsed as it is being executed. This can lead to an interesting issue, look at the following code. Ex: Temp = int(input(&#8220;Enter the temperature in celsius: &#8220;)) if Temp &lt;= 0: print(&#8220;Might want to wear a coat&#8221;) else: prin(&#8220;At&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/joseph-t-gordon.tech\/index.php\/wp-json\/wp\/v2\/posts\/275"}],"collection":[{"href":"https:\/\/joseph-t-gordon.tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/joseph-t-gordon.tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/joseph-t-gordon.tech\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/joseph-t-gordon.tech\/index.php\/wp-json\/wp\/v2\/comments?post=275"}],"version-history":[{"count":2,"href":"https:\/\/joseph-t-gordon.tech\/index.php\/wp-json\/wp\/v2\/posts\/275\/revisions"}],"predecessor-version":[{"id":337,"href":"https:\/\/joseph-t-gordon.tech\/index.php\/wp-json\/wp\/v2\/posts\/275\/revisions\/337"}],"wp:attachment":[{"href":"https:\/\/joseph-t-gordon.tech\/index.php\/wp-json\/wp\/v2\/media?parent=275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/joseph-t-gordon.tech\/index.php\/wp-json\/wp\/v2\/categories?post=275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/joseph-t-gordon.tech\/index.php\/wp-json\/wp\/v2\/tags?post=275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}