Build an Emergency Supply Calculator
Build a Python CLI that calculates emergency water needs and supply plans.
Introduction
30 Second Summary
When an emergency disrupts daily routines, guessing how much water a household needs adds stress to an already difficult moment. A simple plan turns that uncertainty into numbers you can act on.
In this project, you will build a local command-line calculator with Python that turns household size and preparation days into a water target. It will also print a personalized emergency-supply checklist based on Ready.gov and CDC guidance.
What You'll Build
Picture entering two household details and immediately seeing the gallons of water you need, whether your plan covers the three-day target, and a checklist of supplies to gather.
By the end of this project, you'll have:
- A working calculator where you enter your household details and see a personalized water target in gallons.
- A readable emergency-supply checklist covering water, food, bedding, and common emergency-kit essentials.
- A reliable input flow with helpful retry messages when someone enters text, zero, or a negative number.
- Secret Mission: Add a pet question that shows pet-specific supply guidance only for households with pets.
Are there any prerequisites?
You do not need previous coding experience. The first step checks the tools already installed on your Mac before you write any Python.
Before We Start
Before you start coding, take a moment to connect your Emergency Supply Calculator with the planning problem it solves. Clear input keeps the water calculation reliable and prevents the program from crashing.
Verify Your Python Workspace
The calculator needs a working Python interpreter before it can produce a result. Visual Studio Code also needs a connection to that interpreter.
This step confirms both parts before you write the calculator logic. You will finish with one .py file that prints its title in the terminal.
In this step, get ready to:
- Verify Python 3 in the Visual Studio Code terminal.
- Connect Visual Studio Code to the verified Python interpreter.
- Run a starter calculator file from the project folder.
Verify Python in the terminal
A version check proves that the terminal can find Python 3. It also gives you the interpreter version that Visual Studio Code should use.
Why Visual Studio Code Here?
IDLE also provides a Python editor and shell. Visual Studio Code keeps the project file and integrated terminal in one workspace.
That gives you a short loop from editing to running. You can see each result beside the file that produced it.
- Press Cmd+Space (macOS) or the Windows key (Windows) to open your search bar.
- Type Visual Studio Code and press Enter to open it.
- Open the integrated terminal from Visual Studio Code's terminal menu.
- Check the installed Python version by running this command:
python3 --version
What Does This Command Check?
The python3 command starts the Python interpreter installed on your Mac. The --version option asks it to report its installed version.
You should see output that begins with Python 3.
That clears the first workspace check: your terminal can reach Python 3.
Do You See No Python Version?
- Compare your command with the command block above.
- Close the current terminal panel.
- Open a fresh integrated terminal panel.
Help me troubleshoot the Python version check.
Check the extension and interpreter
The Python extension for Visual Studio Code gives the editor its Python run controls. It must also point at the same interpreter that your terminal verified.
- Select Extensions from the Activity Bar on the left.
- Search for Python.
The extension page tells you whether Python from Microsoft is installed.
✔️ Python from Microsoft is installed
The Microsoft extension is ready. Continue below to select the Python interpreter that your terminal verified.
ⓧ Python from Microsoft is missing
- Select Python from Microsoft in the search results.
- Click Install.
The extension page now shows that Python from Microsoft is installed.
Choosing the interpreter is easy to miss because installing the extension does not select Python for this folder.
- Use Visual Studio Code's command picker to choose Python: Select Interpreter.
- Select the Python interpreter whose version matches the terminal result.
The chosen interpreter now appears in Visual Studio Code's status bar. This confirms that the editor uses your verified Python installation.
Can't Select the Interpreter?
- Wait for the Python extension installation to finish.
- Reopen the interpreter picker.
- Choose the same Python interpreter that produced your version result.
Help me connect Visual Studio Code to my Python interpreter.
Create and run the calculator file
A named project folder keeps the source file easy to find. The .py extension tells Visual Studio Code that the file contains Python code.
- Click File in the top menu bar.
- Click Open Folder.
- Select Desktop in the folder picker.
- Use the new-folder control to create emergency-supply-calculator on your Desktop.
- Select emergency-supply-calculator.
- Click Open.
The Explorer sidebar now shows emergency-supply-calculator as the open folder.
- Click New File at the top of the Explorer sidebar.
- Enter emergency_supply_calculator.py and press Enter.
A blank emergency_supply_calculator.py editor tab is now open inside your project folder.
- Add the calculator title to emergency_supply_calculator.py by entering this line:
print("Emergency Supply Calculator")
What Does This Line Do?
The print() function sends the text inside the parentheses to the terminal. The quotation marks keep Emergency Supply Calculator together as one string.
- Press Cmd+S (macOS) or Ctrl+S (Windows) to save emergency_supply_calculator.py.
Before you run the file, what title do you expect the terminal to print?
- Click Run Python File in Terminal in the top-right corner of the editor.
You should see Emergency Supply Calculator in the terminal.
Your workspace is ready: the editor can send a Python file to the verified interpreter. The terminal shows the file's output.
Don't See the Calculator Title?
- Confirm that emergency_supply_calculator.py is the active editor tab.
- Compare your file with the complete code tab below.
- Reselect the Python interpreter that produced your version result.
Help me run my calculator file in Visual Studio Code.
✔️ Awesome, I've got everything!
Your starter file is saved. Its title appears in the terminal when you run it.
ⓧ I'd like to double check the full code
print("Emergency Supply Calculator")
Your Python workspace is connected from file to terminal. Next, you will turn the title into a water calculation for a fixed household.
Calculate Your First Water Total
Your first run proved that Visual Studio Code can send your Python file to the selected interpreter.
The calculator still needs values for the household size plus the number of preparation days.
A hard-coded version uses fixed variables to make the water calculation visible. Those fixed values create a baseline that typed user input can replace in the next step.
In this step, get ready to:
- Store fixed values for the household size plus the preparation duration.
- Calculate the water total with multiplication.
- Observe how a different household size changes the output.
Build the fixed water calculation
Each variable gives a name to one number in the calculation. The program can reuse those names when it multiplies the household size by the preparation duration.
- Replace the existing title line in emergency_supply_calculator.py with this runnable calculation:
people = 2
days = 3
water_gallons_per_person_per_day = 1
water_needed = people * days * water_gallons_per_person_per_day
print("Emergency Supply Calculator")
print("Water needed:", water_needed, "gallons")
What does this code do?
- people stores the fixed household size of 2.
- days stores the preparation duration of 3 days.
- water_gallons_per_person_per_day stores the daily water amount for each person.
- water_needed multiplies the three stored values.
- The first output line keeps the calculator title visible.
- The final output line inserts water_needed into the water message.
- Save emergency_supply_calculator.py.
Before you run it, what water total do you expect from two people over three days? Hold that number in mind.
- Click Run Python File in the editor toolbar.
You'll see Emergency Supply Calculator first.
The next line reads Water needed: 6 gallons. Your file now calculates a six-gallon water target from three fixed values.
Is the water total different?
- Confirm that water_needed multiplies all three variable names.
- Check that the final output line uses water_needed.
- Save emergency_supply_calculator.py before running it again.
Help me find why my Python water calculation does not print six gallons.
Change one starting value
A variable becomes useful when one edit changes every calculation that depends on it. You can prove that connection by changing the household size.
- Find the people = 2 line in emergency_supply_calculator.py.
- Change 2 to 4.
- Save emergency_supply_calculator.py.
Before you run the updated file, what total should four people need over three days? Keep your prediction in mind.
- Click Run Python File in the editor toolbar.
You'll see Water needed: 12 gallons. Your calculator has responded to one changed starting value.
Still seeing six gallons?
- Confirm that the first line now stores 4 in people.
- Save the file before clicking Run Python File again.
Help me work out why changing the household size does not update my water total.
Restore the six-gallon baseline
The next step builds on the original two-person example. Restoring that baseline keeps your saved file in the expected state.
- Change the value stored in people back to 2.
- Save emergency_supply_calculator.py.
Before the final run, what result should the restored values produce? Check your prediction against the terminal.
- Click Run Python File in the editor toolbar.
You'll see Water needed: 6 gallons again. Your first hard-coded calculator is now working from a clean baseline.
✔️ Awesome, I've got everything!
Your saved file matches the six-gallon baseline. Keep emergency_supply_calculator.py open for the next step.
ⓧ I'd like to double check the full code
people = 2
days = 3
water_gallons_per_person_per_day = 1
water_needed = people * days * water_gallons_per_person_per_day
print("Emergency Supply Calculator")
print("Water needed:", water_needed, "gallons")
Your calculator now turns fixed household values into a visible water total. Next, you'll replace those fixed values with answers entered through the terminal.
Make the Calculator Interactive
Your hard-coded calculator already proves the water formula works. Now you can make that formula respond to each household.
Fixed values limit the result to one scenario. Interactive prompts make the calculator reusable.
After the numeric path works, you will test the same conversion with a word.
In this step, get ready to:
- Collect household details through prompts.
- Convert prompt responses into integers.
- Test the calculator with valid input and invalid input.
Collect and convert user input
The input() function always returns text. Wrapping each prompt in int() converts numeric text into an integer that Python can multiply.
The water ratio stays fixed. Its uppercase name identifies it as a constant throughout the program.
- Switch back to emergency_supply_calculator.py in the Visual Studio Code workspace from earlier.
- Press Cmd+A (macOS) or Ctrl+A (Windows) to select the existing code.
- Replace the selected code with the interactive calculator by pasting this code:
WATER_GALLONS_PER_PERSON_PER_DAY = 1
print("Emergency Supply Calculator")
household_size = int(input("How many people are in your household? "))
preparation_days = int(input("How many days are you preparing for? "))
water_needed = household_size * preparation_days * WATER_GALLONS_PER_PERSON_PER_DAY
print("Water needed:", water_needed, "gallons")
What does this code do?
- The WATER_GALLONS_PER_PERSON_PER_DAY constant holds the fixed water ratio used by every calculation.
- Each input() prompt collects one household detail as text.
- Each int() call converts numeric text into an integer.
- The water_needed calculation multiplies the two answers by the daily water ratio.
- The final print() call displays the personalized total.
- Save emergency_supply_calculator.py.
Run a personalized calculation
Before you run the file, consider the water total you expect for four people preparing for five days.
- Click the Run Python File button from earlier.
- Enter 4 when the terminal asks for the household size.
- Enter 5 when the terminal asks for the preparation duration.
You will see Water needed: 20 gallons in the terminal.
Your calculator now adapts the formula to the numbers you enter. That reusable input path is working.
Is the total incorrect?
- Check that you entered 4 for the household size.
- Check that you entered 5 for the preparation duration.
- Confirm that water_needed multiplies household_size by preparation_days by WATER_GALLONS_PER_PERSON_PER_DAY.
Help me fix my interactive water total.
Test non-numeric input
Numeric answers prove the intended path works. The next run probes what happens when int() receives a word.
Before you run the file again, consider whether three can become an integer.
- Click Run Python File again.
- Enter three when the terminal asks for the household size.
This Traceback Is Expected
You will see a ValueError traceback before the second question appears.
This failure is intentional. It proves that the calculator needs a safe way to reject answers that cannot become integers.
The completed interactive version gives you a final comparison point.
✔️ Awesome, I've got everything!
Your code matches the interactive version for this step.
ⓧ I'd like to double check the full code
WATER_GALLONS_PER_PERSON_PER_DAY = 1
print("Emergency Supply Calculator")
household_size = int(input("How many people are in your household? "))
preparation_days = int(input("How many days are you preparing for? "))
water_needed = household_size * preparation_days * WATER_GALLONS_PER_PERSON_PER_DAY
print("Water needed:", water_needed, "gallons")
Your calculator now accepts numeric answers. Next, you will add reusable validation that keeps bad input from ending the program.
Validate User Input
Your calculator now accepts numbers from any household. A word like three still stops the program with a ValueError before it can calculate anything.
In this step, you will add a reusable Python function for input validation. It keeps each question active until it receives a positive whole number.
In this step, get ready to:
- Build get_positive_integer(prompt) with a loop and exception handling.
- Reject text and values that are not positive whole numbers.
- Route both questions through the validation function.
Build a reusable validation loop
A validation loop keeps asking the same question until the learner enters an acceptable value. One reusable function can apply that rule to both calculator prompts.
- Place your cursor between the constant and the calculator title in emergency_supply_calculator.py.
- Insert the validation function by copying this code into that space:
def get_positive_integer(prompt):
while True:
try:
value = int(input(prompt))
if value > 0:
return value
print("Please enter a whole number greater than 0.")
except ValueError:
print("Please enter a whole number greater than 0.")
What Does This Function Do?
- The prompt parameter holds the question that the function displays.
- The while True loop repeats until the function sends an accepted value back.
- The try block gives int() a chance to convert the entered text.
- The if value > 0 condition accepts positive whole numbers.
- The except ValueError block catches text that cannot become an integer.
- Save emergency_supply_calculator.py.
- Click Run Python File in the top-right corner of the editor.
- Enter 2 when the calculator asks for your household size.
- Enter 3 when the calculator asks for the number of days.
You will see Water needed: 6 gallons. This confirms the new function is defined without breaking the calculator's numeric path.
Seeing a Syntax Error?
- Check that every line inside get_positive_integer(prompt) is indented exactly as shown.
- Make sure the function sits below WATER_GALLONS_PER_PERSON_PER_DAY.
Ask for help checking the function's indentation and placement.
Route both questions through validation
The function now contains the validation rule. The two calculator questions need to use it before invalid input can reach the calculation.
- Locate the assignments to household_size and preparation_days below the calculator title.
- Replace both assignments with these function calls:
household_size = get_positive_integer("How many people are in your household? ")
preparation_days = get_positive_integer("How many days are you preparing for? ")
How Do the Prompts Reuse the Function?
- Each call sends its own question into get_positive_integer(prompt).
- The function returns an accepted integer to the matching variable.
- Both questions now follow one validation rule.
- Save emergency_supply_calculator.py.
- Predict whether entering three stops the program or triggers another prompt.
- Click Run Python File.
- Enter three for the household size.
- Enter 2 when the household question repeats.
- Enter 3 for the preparation duration.
You will see Please enter a whole number greater than 0. after entering text. The program stays open and eventually displays Water needed: 6 gallons.
That reliability gap is closed: your calculator now recovers from text and completes the calculation.
Does Text Still Stop the Program?
- Check that both prompt assignments call get_positive_integer().
- Confirm that except ValueError lines up with try inside the function.
Ask for help tracing why invalid input still reaches the calculation.
✔️ Awesome, I've got everything!
Your saved file now contains the reusable validation function and two protected prompts.
ⓧ I'd like to double check the full code
WATER_GALLONS_PER_PERSON_PER_DAY = 1
def get_positive_integer(prompt):
while True:
try:
value = int(input(prompt))
if value > 0:
return value
print("Please enter a whole number greater than 0.")
except ValueError:
print("Please enter a whole number greater than 0.")
print("Emergency Supply Calculator")
household_size = get_positive_integer("How many people are in your household? ")
preparation_days = get_positive_integer("How many days are you preparing for? ")
water_needed = household_size * preparation_days * WATER_GALLONS_PER_PERSON_PER_DAY
print("Water needed:", water_needed, "gallons")
Test every input path
Text is only one invalid path. The positive-number condition also needs to reject zero and negative values before the calculator uses them.
- Predict how many household entries the function rejects before it accepts a value.
- Click Run Python File.
- Enter three for the household size.
- Enter 0 when the household question repeats.
- Enter -1 when the household question repeats again.
- Enter 2 when the household question appears once more.
- Enter 2 for the preparation duration.
You will see the retry message after each of the first three household entries. After the two valid values, you will see Water needed: 4 gallons.
Why Are Zero and Negative Numbers Rejected?
The value > 0 condition only accepts integers above zero. Every other integer reaches the retry message before the loop starts again.
🙋♀️ Is an Invalid Number Being Accepted?
- Check that the condition uses value > 0.
- Confirm that the accepted value is returned inside the if block.
Ask for help checking why zero or a negative number passes validation.
Your calculator can now recover from typing mistakes and impossible values. Next, you will turn its water total into a personalized emergency supply plan.
Generate Your Supply Plan
Your calculator in Visual Studio Code now recovers from invalid input. Every household can reach a valid water total.
A water number alone leaves the rest of the supply plan unclear. Reusable functions will calculate the water target. A structured checklist will turn that result into practical guidance.
In this step, get ready to:
- Move the water calculation into a reusable function.
- Build a personalized checklist with a dictionary.
- Display the complete household supply plan.
Separate the water calculation
A calculation function gives the water formula one clear home. The main part of the program can call that function whenever it needs a total.
- Return to emergency_supply_calculator.py from earlier.
- Place the calculation function below get_positive_integer(prompt) by copying this code:
def calculate_water_gallons(people, days):
return people * days * WATER_GALLONS_PER_PERSON_PER_DAY
What does this function do?
- The people parameter receives the validated household size.
- The days parameter receives the validated preparation duration.
- The return statement multiplies both values by WATER_GALLONS_PER_PERSON_PER_DAY.
- Find water_needed = household_size * preparation_days * WATER_GALLONS_PER_PERSON_PER_DAY near the bottom of the file.
- Replace that calculation with this function call:
water_needed = calculate_water_gallons(household_size, preparation_days)
Why move the formula?
The main section now names the calculation it needs. The formula stays inside calculate_water_gallons().
Before you run this refactor, do you expect the six-gallon result to stay the same?
- Save emergency_supply_calculator.py.
- Click Run Python File in the editor toolbar.
- Enter 2 at the household-size prompt.
- Enter 3 at the preparation-days prompt.
You will see Water needed: 6 gallons in the terminal.
That refactor is working. Your water calculation now has a reusable home.
Seeing the wrong water total?
- Check that calculate_water_gallons() multiplies people by days by WATER_GALLONS_PER_PERSON_PER_DAY.
- Check that the water_needed line passes household_size first.
- Check that the same line passes preparation_days second.
Help me debug my water calculation function.
Build the personalized checklist
Each checklist entry needs a label plus its household-specific guidance. Key-value pairs keep those two parts together for later display.
- Place the checklist function below calculate_water_gallons() by copying this code:
def build_checklist(people, days, water_gallons):
return {
"Water": str(water_gallons) + " gallons",
"Non-perishable food": "Plan for " + str(days) + " days",
"Sleeping bag or warm blanket": str(people) + " total",
"Battery-powered or hand crank radio": "Include",
"Flashlight": "Include",
"First aid kit": "Include",
"Extra batteries": "Include",
"Manual can opener": "Include if using canned food",
"Local maps": "Include",
"Cell phone charger and backup battery": "Include",
}
What does this checklist store?
- Each key names one supply category.
- Each value stores the guidance that belongs beside its key.
- The str() conversions let numeric results join text labels.
- The returned dictionary keeps the complete checklist in one value.
- Find the water_needed function call near the bottom of the file.
- Create the checklist below that line by copying this code:
supply_checklist = build_checklist(
household_size,
preparation_days,
water_needed,
)
How is the checklist personalized?
The build_checklist() call receives the household size. It also receives the preparation duration.
The completed water calculation becomes the third argument. The returned dictionary is stored in supply_checklist.
- Save emergency_supply_calculator.py.
- Click Run Python File.
- Enter 2 at the household-size prompt.
- Enter 3 at the preparation-days prompt.
The terminal reaches Water needed: 6 gallons without an error. This confirms that supply_checklist was created successfully.
Seeing a dictionary error?
- Check that every checklist key is followed by a colon.
- Check that every checklist entry except the last one ends with a comma.
- Check that the closing brace lines up with return.
Help me fix my checklist dictionary.
Display the complete plan
The final display function prints the household summary first. A duration check selects the correct water message before a loop prints every checklist entry.
- Find WATER_GALLONS_PER_PERSON_PER_DAY = 1 at the top of the file.
- Replace that line with these two constants:
WATER_GALLONS_PER_PERSON_PER_DAY = 1
MINIMUM_WATER_DAYS = 3
Why keep the minimum in a constant?
The name MINIMUM_WATER_DAYS gives the duration check a clear meaning. Its value stores the three-day water target used by the plan.
- Place the display function below build_checklist() by copying this code:
def display_plan(people, days, checklist):
print("\nYour emergency supply plan")
print("Household size:", people)
print("Days planned:", days)
if days < MINIMUM_WATER_DAYS:
print("Warning: The CDC recommends storing at least a 3-day supply of water.")
else:
print("Your water plan covers at least the CDC's 3-day target.")
print("\nSupply checklist")
for item, amount in checklist.items():
print("-", item + ":", amount)
How does the display work?
- The first three print() calls show the plan heading plus its household details.
- The if branch handles plans shorter than MINIMUM_WATER_DAYS.
- The else branch handles plans that meet the target.
- The checklist.items() loop retrieves each supply name with its guidance.
- Save emergency_supply_calculator.py.
- Click Run Python File.
- Enter 2 at the household-size prompt.
- Enter 3 at the preparation-days prompt.
You will see the existing six-gallon result without a syntax error. This confirms that the new constants plus the display function are valid.
- Find print("Water needed:", water_needed, "gallons") at the bottom of the file.
- Replace that line with this display call:
display_plan(household_size, preparation_days, supply_checklist)
How does the full flow connect?
The main section collects valid input before calculating water_needed.
It builds supply_checklist before passing the finished data to display_plan().
- Save emergency_supply_calculator.py.
Before you run the complete plan, what do you expect the duration check to report for two days?
- Click Run Python File.
- Enter 2 at the household-size prompt.
- Enter 2 at the preparation-days prompt.
You will see Water: 4 gallons in the supply checklist.
You will also see Warning: The CDC recommends storing at least a 3-day supply of water.
The checklist continues through Cell phone charger and backup battery.
That is the complete core calculator working. Validated household input now becomes a readable emergency supply plan.
Missing part of the supply plan?
- Check that display_plan() receives supply_checklist as its third argument.
- Check that for item, amount in checklist.items(): ends with a colon.
- Check that the final print() call is indented inside the loop.
Help me debug my incomplete supply plan output.
✔️ Awesome, I've got everything!
Your complete calculator now validates input. It calculates water needs before printing the personalized supply plan.
- Save emergency_supply_calculator.py one more time.
ⓧ I'd like to double check the full code
WATER_GALLONS_PER_PERSON_PER_DAY = 1
MINIMUM_WATER_DAYS = 3
def get_positive_integer(prompt):
while True:
try:
value = int(input(prompt))
if value > 0:
return value
print("Please enter a whole number greater than 0.")
except ValueError:
print("Please enter a whole number greater than 0.")
def calculate_water_gallons(people, days):
return people * days * WATER_GALLONS_PER_PERSON_PER_DAY
def build_checklist(people, days, water_gallons):
return {
"Water": str(water_gallons) + " gallons",
"Non-perishable food": "Plan for " + str(days) + " days",
"Sleeping bag or warm blanket": str(people) + " total",
"Battery-powered or hand crank radio": "Include",
"Flashlight": "Include",
"First aid kit": "Include",
"Extra batteries": "Include",
"Manual can opener": "Include if using canned food",
"Local maps": "Include",
"Cell phone charger and backup battery": "Include",
}
def display_plan(people, days, checklist):
print("\nYour emergency supply plan")
print("Household size:", people)
print("Days planned:", days)
if days < MINIMUM_WATER_DAYS:
print("Warning: The CDC recommends storing at least a 3-day supply of water.")
else:
print("Your water plan covers at least the CDC's 3-day target.")
print("\nSupply checklist")
for item, amount in checklist.items():
print("-", item + ":", amount)
print("Emergency Supply Calculator")
household_size = get_positive_integer("How many people are in your household? ")
preparation_days = get_positive_integer("How many days are you preparing for? ")
water_needed = calculate_water_gallons(household_size, preparation_days)
supply_checklist = build_checklist(
household_size,
preparation_days,
water_needed,
)
display_plan(household_size, preparation_days, supply_checklist)
How to use this reference
This reference shows the exact finished structure of emergency_supply_calculator.py.
Secret mission
Add Pet-Aware Planning
Your calculator already covers the people in a household. Extend it with a validated pet question that adds Ready.gov's pet-supply reminder only when the household has pets.
Clean Up Your Resources
Clean Up Your Resources
Everything you built runs locally in Visual Studio Code. The calculator uses no paid services, so keeping it on your Mac creates no ongoing cost.
Choose whether to keep the calculator ready for more experiments, pause your work, or delete the local files.
Resources you used:
- The emergency-supply-calculator workspace folder containing emergency_supply_calculator.py.
Keep everything running
No action is needed. Choose this option if you want to keep testing household plans or extending the calculator.
- Leave the emergency-supply-calculator workspace open in Visual Studio Code.
- Keep emergency_supply_calculator.py in its current folder.
- Run the calculator again whenever you want to generate another supply plan.
Pause - I'll come back to this later
The calculator stops after each run, so there is no server or background process to shut down. Pausing means saving the file before you step away.
- Save emergency_supply_calculator.py.
- Close Visual Studio Code.
- Keep the emergency-supply-calculator folder in its current location for your next session.
Delete - I don't want to use this again
Deleting the workspace removes your finished calculator. Keep a separate copy first if you may want to revisit the code.
- Close Visual Studio Code.
- Locate the emergency-supply-calculator folder in Finder.
- Move the emergency-supply-calculator folder to the Bin.
- Empty the Bin to remove the calculator permanently.
- Confirm that the emergency-supply-calculator folder no longer appears in its original location.
Your Python Setup Stays Available
Deleting the workspace leaves Python 3, Visual Studio Code, and the Python extension installed. You can reuse that setup for future Python projects.
Nice Work!
Nice Work!
You did it. Your Python calculator now turns reliable household input into a personalized emergency supply plan.
You've learned how to:
- Use user input and arithmetic to calculate household water needs.
- Build reusable input validation that rejects text or non-positive numbers without crashing the program.
- Combine functions, conditionals, loops, and a dictionary to generate a personalized checklist based on Ready.gov and CDC guidance.
- Secret Mission: Extended the calculator with validated pet-aware planning that shows extra guidance only for households with pets.
Ready to quiz yourself?