{"id":39,"date":"2025-11-20T08:21:53","date_gmt":"2025-11-20T08:21:53","guid":{"rendered":"https:\/\/almohnar.msu.domains\/demo\/?page_id=39"},"modified":"2025-11-20T08:45:28","modified_gmt":"2025-11-20T08:45:28","slug":"transportation-co%e2%82%82-emissions-calculator-python-project","status":"publish","type":"page","link":"https:\/\/almohnar.msu.domains\/demo\/transportation-co%e2%82%82-emissions-calculator-python-project\/","title":{"rendered":"Transportation CO\u2082 Emissions Calculator (Python Project)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Situation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This project was completed as an individual assignment for\u00a0<strong>CSE 231<\/strong>. I wanted to create something simple that connects basic Python programming with an environmental topic. The idea came from noticing how different transportation choices affect CO\u2082 emissions and wanting to visualize that impact.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"702\" height=\"393\" src=\"https:\/\/almohnar.msu.domains\/demo\/wp-content\/uploads\/2025\/11\/CarbonEmissionsAdobeStock_302463691.jpeg.optimal.jpeg\" alt=\"\" class=\"wp-image-40\" srcset=\"https:\/\/almohnar.msu.domains\/demo\/wp-content\/uploads\/2025\/11\/CarbonEmissionsAdobeStock_302463691.jpeg.optimal.jpeg 702w, https:\/\/almohnar.msu.domains\/demo\/wp-content\/uploads\/2025\/11\/CarbonEmissionsAdobeStock_302463691.jpeg.optimal-300x168.jpeg 300w\" sizes=\"auto, (max-width: 702px) 100vw, 702px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Task<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">My task was to create a small tool that estimates how much carbon dioxide is released when someone travels a certain distance. I needed to allow the user to choose a transportation mode (car, train, bus, or plane), enter distance, and receive a clear CO\u2082 emission estimate.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"684\" src=\"https:\/\/almohnar.msu.domains\/demo\/wp-content\/uploads\/2025\/11\/0QR-44Cl9I4Y7pUYQ-1024x684.jpg\" alt=\"\" class=\"wp-image-42\" srcset=\"https:\/\/almohnar.msu.domains\/demo\/wp-content\/uploads\/2025\/11\/0QR-44Cl9I4Y7pUYQ-1024x684.jpg 1024w, https:\/\/almohnar.msu.domains\/demo\/wp-content\/uploads\/2025\/11\/0QR-44Cl9I4Y7pUYQ-300x200.jpg 300w, https:\/\/almohnar.msu.domains\/demo\/wp-content\/uploads\/2025\/11\/0QR-44Cl9I4Y7pUYQ-768x513.jpg 768w, https:\/\/almohnar.msu.domains\/demo\/wp-content\/uploads\/2025\/11\/0QR-44Cl9I4Y7pUYQ.jpg 1400w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Action<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To complete the task, I took the following steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Wrote a short Python script<\/li>\n\n\n\n<li>Added user inputs for transportation type and distance<\/li>\n\n\n\n<li>Used basic emission factors for each travel mode<\/li>\n\n\n\n<li>Applied a simple formula to convert emissions from grams to kilograms<\/li>\n\n\n\n<li>Organized the output so the result is clear and easy to read<\/li>\n\n\n\n<li>Tested the program with several inputs to ensure it worked correctly<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Code Example<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>print(\"Transportation CO\u2082 Emissions Calculator\")\n\nmode = input(\"Choose transport (car\/train\/bus\/plane): \").lower()\ndistance = float(input(\"Enter distance in km: \"))\n\nif mode == \"car\":\n    factor = 120\nelif mode == \"train\":\n    factor = 40\nelif mode == \"bus\":\n    factor = 80\nelif mode == \"plane\":\n    factor = 255\nelse:\n    factor = 100\n\nemissions_kg = (distance * factor) \/ 1000\n\nprint(\"\\n--- CO\u2082 Emission Estimate ---\")\nprint(f\"Transport mode: {mode}\")\nprint(f\"Distance: {distance} km\")\nprint(f\"Estimated Emissions: {emissions_kg:.2f} kg CO\u2082\")\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Result<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After completing the project, I gained a better understanding of how emission factors differ between transportation types. I also practiced basic Python input\/output and conditional logic. The final result is a small but effective tool that visually demonstrates how travel decisions impact the environment. This project helped me think more about sustainability and allowed me to practice simple programming skills with a real-world concept.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Situation This project was completed as an individual assignment for\u00a0CSE 231. I wanted to create something simple that connects basic Python programming with an environmental topic. The idea came from noticing how different transportation choices affect CO\u2082 emissions and wanting to visualize that impact. Task My task was to create a small tool that estimates [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-39","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/almohnar.msu.domains\/demo\/wp-json\/wp\/v2\/pages\/39","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/almohnar.msu.domains\/demo\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/almohnar.msu.domains\/demo\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/almohnar.msu.domains\/demo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/almohnar.msu.domains\/demo\/wp-json\/wp\/v2\/comments?post=39"}],"version-history":[{"count":4,"href":"https:\/\/almohnar.msu.domains\/demo\/wp-json\/wp\/v2\/pages\/39\/revisions"}],"predecessor-version":[{"id":49,"href":"https:\/\/almohnar.msu.domains\/demo\/wp-json\/wp\/v2\/pages\/39\/revisions\/49"}],"wp:attachment":[{"href":"https:\/\/almohnar.msu.domains\/demo\/wp-json\/wp\/v2\/media?parent=39"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}