{"id":234,"date":"2025-05-25T19:14:23","date_gmt":"2025-05-25T19:14:23","guid":{"rendered":"https:\/\/r0b3rt.com\/andr-web\/?p=234"},"modified":"2025-05-25T19:14:23","modified_gmt":"2025-05-25T19:14:23","slug":"python-disposal-evaluation","status":"publish","type":"post","link":"http:\/\/r0b3rt.com\/andr-web\/python-disposal-evaluation\/","title":{"rendered":"Python &#8211; Disposal Evaluation"},"content":{"rendered":"<p><a href=\"https:\/\/www.essentialwidgets.com\/programs\/evaluation_program.html\">HTML Program<\/a><\/p>\n<pre>\r\n# Disposal Evaluation Program\r\n\r\ndef get_input(prompt):\r\n    \"\"\"Utility function to get user input with validation.\"\"\"\r\n    while True:\r\n        try:\r\n            value = input(prompt)\r\n            # Accepting numerical values for certain prompts\r\n            return float(value) if prompt.startswith((\"How long\", \"cash value\", \"size\", \"emotional value\")) else value\r\n        except ValueError:\r\n            print(\"Please enter a valid input.\")\r\n\r\ndef evaluate_item(use_time, next_use_time, cash_value, size, emotional_value):\r\n    \"\"\"Evaluates the item's value based on the input factors.\"\"\"\r\n    score = 0\r\n\r\n    # Evaluation Criteria\r\n    score = 25 - use_time\r\n    score += (25 - next_use_time)\r\n    score += int(cash_value \/ 100)\r\n    score += (25 - size)\r\n    score += emotional_value\r\n    return score\r\n\r\ndef main():\r\n    print(\"Disposal Evaluation Program\")\r\n    \r\n    while True:\r\n        # Gather information from the user\r\n        use_time = get_input(\"How long has it been (in months) since you have used this item? \")\r\n        next_use_time = get_input(\"How long (in months) until you think you will use this item? \")\r\n        cash_value = get_input(\"What is the cash value of the item? \")\r\n        size = get_input(\"How much size (in cubic feet) does the item take up? \")\r\n        emotional_value = get_input(\"Rate the emotional value of the item from 1 to 50. \")\r\n\r\n        # Convert relevant inputs to float\r\n        cash_value = float(cash_value)\r\n        size = float(size)\r\n        emotional_value = float(emotional_value)\r\n        \r\n        # Evaluate the item\r\n        score = evaluate_item(use_time, next_use_time, cash_value, size, emotional_value)\r\n\r\n        # Display the score and results\r\n        print(f\"\\nFinal score for the item: {int(score)}\")\r\n\r\n        # Display results\r\n        if score > 100:\r\n            print(\"\\nRecommendation: Keep the item.\")\r\n        elif score < 80:\r\n            print(\"\\nRecommendation: Dispose of the item.\")\r\n        else:\r\n            print(\"\\nRecommendation: This is something you should think about.\")\r\n\r\n        # Ask the user if they want to evaluate another item or quit\r\n        another_item = input(\"\\nWould you like to evaluate another item? (Y\/N): \").strip().lower()\r\n        if another_item != 'y':\r\n            print(\"Thank you for using the Disposal Evaluation Program. Goodbye!\")\r\n            break\r\n\r\nif __name__ == \"__main__\":\r\n    main()\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>HTML Program # Disposal Evaluation Program def get_input(prompt): &#8220;&#8221;&#8221;Utility function to get user input with validation.&#8221;&#8221;&#8221; while True: try: value = input(prompt) # Accepting numerical values for certain prompts return float(value) if prompt.startswith((&#8220;How long&#8221;, &#8220;cash value&#8221;, &#8220;size&#8221;, &#8220;emotional value&#8221;)) else value except ValueError: print(&#8220;Please enter a valid input.&#8221;) def evaluate_item(use_time, next_use_time, cash_value, size, emotional_value): &#8220;&#8221;&#8221;Evaluates &hellip; <a href=\"http:\/\/r0b3rt.com\/andr-web\/python-disposal-evaluation\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Python &#8211; Disposal Evaluation&#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-234","post","type-post","status-publish","format-standard","hentry","category-writing-code"],"_links":{"self":[{"href":"http:\/\/r0b3rt.com\/andr-web\/wp-json\/wp\/v2\/posts\/234","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=234"}],"version-history":[{"count":1,"href":"http:\/\/r0b3rt.com\/andr-web\/wp-json\/wp\/v2\/posts\/234\/revisions"}],"predecessor-version":[{"id":235,"href":"http:\/\/r0b3rt.com\/andr-web\/wp-json\/wp\/v2\/posts\/234\/revisions\/235"}],"wp:attachment":[{"href":"http:\/\/r0b3rt.com\/andr-web\/wp-json\/wp\/v2\/media?parent=234"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/r0b3rt.com\/andr-web\/wp-json\/wp\/v2\/categories?post=234"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/r0b3rt.com\/andr-web\/wp-json\/wp\/v2\/tags?post=234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}