Inspiration
As a member of an sustainability centered organization, lowering my water footprint is something I have been interested in. While thinking about how to do this, I realized that creating a calculator that allows people to realize where and how much they need to improve would be a big help, hence I was inspired to code this project!
What it does
The calculator will ask 5 simple multiple choice questions regarding your daily water usage. As mentioned in the 'how we built it' section, a dictionary binds each choice to a point value, so in the end all of the points are added up.
How we built it
We built this project in visual studio code using python and the turtle graphic library. Utilizing a function with a for loop and dictionary that is filled with a list and multiple tuples, we were able to create a simple way to ask questions and rank the responses with a footprint score, as well as add all of this together in the end. The calculator is able to use the for loop to print out the question and the choices that can be inputed, defined via a dictionary that contains a list with the possible answers, each item a tuple that contains the answer itself and its water footprint point value.
Challenges we ran into
A challenge that we had to combat was how we wanted to ask 5 similar questions, but having to type each one out and make many conditional statements to find out how much each solution is worth in water footprint points would be a hassle and would be extremely un-concise. Instead, we figured out how to use dictionaries, lists, and tuples all combined into one with the help of a function so that questions could all be asked by simply calling the same function 5 times! This greatly reduced the length of the code.
Accomplishments that we're proud of
We are proud of being able to create a functional calculator that asks 5 simple questions easily, takes in responses, and is able to automatically grab a value of each possible answer choice and add it all together. It is able to accomplish something that I really appreciate, helping everybody to live a greener life.
What we learned
We were able to learn a lot about coding in python, especially how to grab the index of an item in a list or tuple! We also learned how to use dictionaries, something we had not coded with before. It was a tremendous learning experience overall.
What's next for Water Footprint Status Calculator
Next steps are to add more detailed questions and incorporate more numbers and research to make it more accurate. After this, the next addition would be to add a page of solutions that people can choose from to complete so that they know HOW they can accomplish improvements!
Log in or sign up for Devpost to join the conversation.