{"id":228,"date":"2025-05-25T19:01:48","date_gmt":"2025-05-25T19:01:48","guid":{"rendered":"https:\/\/r0b3rt.com\/andr-web\/?p=228"},"modified":"2025-05-25T19:01:48","modified_gmt":"2025-05-25T19:01:48","slug":"python-temperature-converter","status":"publish","type":"post","link":"http:\/\/r0b3rt.com\/andr-web\/python-temperature-converter\/","title":{"rendered":"Python &#8211; Temperature Converter"},"content":{"rendered":"<p><a href=\"https:\/\/www.essentialwidgets.com\/programs\/temperature.html\">HTML Converter<\/a><\/p>\n<pre>\r\nimport sys\r\nMyExit = \"Exit\"\r\n\r\nwhile MyExit != \"X\":\r\n    MyTitle = \"Temperature Conversion Program\"\r\n    MyInstructions = \"Enter C if convertion from C to F.\\n\"\r\n    MyInstructions = MyInstructions + \"Enter F if converting from F to C\\n\"\r\n    MyInstructions = MyInstructions + \"Enter X to Exit\"\r\n    print (\"\\n\",MyTitle,\"\\n\")\r\n    print (MyInstructions+\"\\n\")\r\n    MyPath=input(\"Enter C or F: \")\r\n    if MyPath == \"C\":\r\n        StartTemp=int(input(\"Enter temperature: \"))\r\n        MyOutput = (StartTemp*1.8)+32\r\n        ResultPath=\"F\"\r\n    elif MyPath == \"F\":\r\n        StartTemp=int(input(\"Enter temperature: \"))\r\n        MyOutput = (StartTemp-32) * (5\/9)\r\n        ResultPath=\"C\"\r\n    else:\r\n        sys.exit()\r\n    print(StartTemp, MyPath, \"is the same as\",MyOutput,ResultPath)\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>HTML Converter import sys MyExit = &#8220;Exit&#8221; while MyExit != &#8220;X&#8221;: MyTitle = &#8220;Temperature Conversion Program&#8221; MyInstructions = &#8220;Enter C if convertion from C to F.\\n&#8221; MyInstructions = MyInstructions + &#8220;Enter F if converting from F to C\\n&#8221; MyInstructions = MyInstructions + &#8220;Enter X to Exit&#8221; print (&#8220;\\n&#8221;,MyTitle,&#8221;\\n&#8221;) print (MyInstructions+&#8221;\\n&#8221;) MyPath=input(&#8220;Enter C or F: &#8220;) &hellip; <a href=\"http:\/\/r0b3rt.com\/andr-web\/python-temperature-converter\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Python &#8211; Temperature Converter&#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":[1],"tags":[],"class_list":["post-228","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/r0b3rt.com\/andr-web\/wp-json\/wp\/v2\/posts\/228","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=228"}],"version-history":[{"count":1,"href":"http:\/\/r0b3rt.com\/andr-web\/wp-json\/wp\/v2\/posts\/228\/revisions"}],"predecessor-version":[{"id":229,"href":"http:\/\/r0b3rt.com\/andr-web\/wp-json\/wp\/v2\/posts\/228\/revisions\/229"}],"wp:attachment":[{"href":"http:\/\/r0b3rt.com\/andr-web\/wp-json\/wp\/v2\/media?parent=228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/r0b3rt.com\/andr-web\/wp-json\/wp\/v2\/categories?post=228"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/r0b3rt.com\/andr-web\/wp-json\/wp\/v2\/tags?post=228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}