Python ROI & Pricing Tier Calculator

Build a client ROI calculator with type casting and conditional logic.

Introduction

30 Second Summary

Every business makes pricing decisions. Whether you're a freelancer quoting a client or a team lead evaluating vendor contracts, knowing how to calculate return on investment turns guesswork into confidence.

In this project, you will build a Client ROI & Pricing Tier Calculator in Google Colab. The tool collects client details through an interactive form, computes annual savings and ROI percentage, then automatically assigns discount tiers based on project value.

What You'll Build

An interactive Google Colab notebook that uses Colab Forms to present a clean input dashboard, converts text entries into math-ready numbers with type casting, calculates financial metrics, and routes clients into pricing tiers using conditional logic.

By the end of this project, you'll have:

  • A Colab Forms input dashboard that collects client details through interactive form fields.
  • An ROI calculation engine using type casting and math operators to compute annual savings, ROI percentage, and payback period.
  • An automated pricing tier system using if/elif/else logic to assign Silver, Gold, or Platinum discounts.
  • A published GitHub repository with an Open in Colab badge so anyone can click and run your calculator instantly.
  • Secret Mission: A multi-client comparison report that processes a list of clients and outputs a ranked pricing summary.

Are there any prerequisites?

This project is Day 2 of a Python series. You need a Google account, a GitHub account, and the python-portfolio repository from Day 1. If you haven't completed Day 1 yet, start there first to set up Google Colab and GitHub.

Before We Start

Before We Start...

Set Up Your Day 2 Notebook

Yesterday you set up Google Colab and GitHub for your Python portfolio. Today you're building a Client ROI & Pricing Tier Calculator that automates real pricing decisions.

Before writing any Python logic, you need a clean, branded notebook that looks professional. In this step, you'll create your Day 2 notebook and set it up with a header and section structure.

In this step, get ready to:
  • Create a new Colab notebook and rename it.
  • Add a branded markdown header with the project title and Python concepts.
  • Add a section heading for the Client Input Dashboard.
Create your notebook and add a branded header

A branded header cell gives your notebook a professional feel. It shows anyone who opens it exactly what the tool does and which Python skills it covers.

  • Go to colab.research.google.com in your browser.
  • Click New notebook in the bottom-left of the pop-up window.
  • Click the notebook title at the top-left (it says Untitled0.ipynb) and rename it to Day_2_Client_ROI_Pricing_Tier_Calculator.ipynb.
  • Delete the default empty code cell by clicking the trash can icon in the top-right corner of the cell.
  • Click + Text in the toolbar at the top to add a new text cell.
  • Paste the following markdown into the text cell to create your branded header:
# Day 2: Client ROI & Pricing Tier Calculator

**Python Concepts Covered:**
- Type Casting (`float()`, `int()`)
- Mathematical Operators (`*`, `/`, `-`)
- Conditional Logic (`if`, `elif`, `else`)
- Colab Forms (`#@param`)

This tool automates client pricing decisions. It collects project details, calculates ROI from operational efficiencies, and assigns clients to volume discount tiers automatically.

What does this markdown do?

The # symbol creates a large heading. The **bold** syntax makes text bold, and the dashes create a bulleted list.

When you click outside the text cell, Colab renders it as formatted text instead of showing the raw markdown symbols.

  • Click anywhere outside the text cell to render the markdown.

You should see a large heading, a bold label, a bulleted list of Python concepts, and a one-line description rendered in clean formatting.

Seeing raw markdown symbols instead of formatted text?

Double-check that you clicked outside the cell. The cell must be deselected for Colab to render the markdown.

If the formatting still looks off, make sure there's a blank line between the heading and the bold label line.

Help me fix my text cell formatting in Google Colab.

Add the Client Input Dashboard heading

This second text cell creates a visual section break. It tells users where to enter their client details once you build the form in the next step.

  • Hover below your header cell until you see the + Text button appear between cells, then click it to add a second text cell.
  • Paste the following markdown into the new text cell:
## Client Input Dashboard

Enter your client's project details in the form fields on the right. These values will be used to calculate ROI and determine their pricing tier.

What does this cell do?

The ## creates a smaller sub-heading (level 2). This gives your notebook clear sections so users know where the interactive form will live.

  • Click outside the cell to render the markdown.

You should see a bold sub-heading that reads "Client Input Dashboard" followed by the instruction text.

Cell appeared in the wrong position?

If the text cell ended up above your header, click the up or down arrow icons in the cell's toolbar to move it below the header cell.

Help me rearrange cells in my Google Colab notebook.

Save your notebook
  • Press Cmd+S (macOS) or Ctrl+S (Windows) to save the notebook to Google Drive.

You should see a brief "All changes saved" message near the notebook title at the top. Your notebook is now stored in your Google Drive's Colab Notebooks folder.

✔️ Awesome, I've got everything!

Great. Double check you have two rendered text cells: the branded header and the Client Input Dashboard heading. No code cells should be visible yet.

ⓧ I'd like to double check the full code

Here's what both text cells should look like when you double-click them to edit. Your notebook should have these two cells in order, with no code cells.

# Day 2: Client ROI & Pricing Tier Calculator

**Python Concepts Covered:**
- Type Casting (`float()`, `int()`)
- Mathematical Operators (`*`, `/`, `-`)
- Conditional Logic (`if`, `elif`, `else`)
- Colab Forms (`#@param`)

This tool automates client pricing decisions. It collects project details, calculates ROI from operational efficiencies, and assigns clients to volume discount tiers automatically.
## Client Input Dashboard

Enter your client's project details in the form fields on the right. These values will be used to calculate ROI and determine their pricing tier.

Your notebook is branded and ready to go. Next up, you'll build the interactive client input form using Colab Forms and learn how to convert text into numbers with type casting.

Build the Client Input Form

In Step 1, you set up your notebook with a professional header and section heading. Now it's time to make your calculator actually do something.

The problem: when someone types a number into a form field, Python receives it as text, not as a number. You can't do math on text. In this step, you'll build an interactive form using Colab Forms, then learn how to convert those text inputs into real numbers using type casting.

In this step, get ready to:
  • Create an interactive client input form with Colab Forms fields.
  • Convert text inputs into math-ready numbers using type casting.
  • See exactly why casting matters with a hands-on comparison.
Create the Colab Forms input cell

Colab Forms lets you add interactive fields (text boxes, dropdowns, sliders) directly inside a code cell. Instead of the learner reading raw code, they see a clean form on the right side of the cell where they can type values.

You'll use #@param {type:"string"} to create each form field. The reason you're using string type for numeric values (instead of number) is intentional. This mirrors real-world scenarios where data from APIs, CSVs, or form submissions arrives as text.

  • Click + Code in the toolbar to add a new code cell below your text cells.
  • Type the following code into the new cell:
#@title Client ROI & Pricing Tier Calculator
#@markdown Enter your client's details below.

client_name = 'Acme Corp' #@param {type:"string"}
project_value_text = '25000' #@param {type:"string"}
monthly_ops_spend_text = '8000' #@param {type:"string"}

print(f"Client data received for: {client_name}")
print(f"Project value (text): {project_value_text}")
print(f"Monthly spend (text): {monthly_ops_spend_text}")
print()
print(f"Type of project_value_text: {type(project_value_text)}")
print(f"Type of monthly_ops_spend_text: {type(monthly_ops_spend_text)}")

What does this code do?

  • #@title gives the cell a display name that appears as a header when the code is hidden.
  • #@markdown adds instructional text above the form fields.
  • #@param {type:"string"} turns each variable into an editable form field on the right side of the cell.
  • type() reveals what Python thinks each value is. Right now, even the numbers are stored as strings.
  • Run the cell by clicking the play button on the left side of the cell, or press Shift+Enter.
  • Look at the right side of the cell. You should see form fields with Acme Corp, 25000, and 8000 as default values.
  • Check the output below the cell. Both type lines should say <class 'str'>. This confirms the numeric values are currently text strings.

Don't see form fields on the right?

  • Make sure there is no space between #@param and the curly braces. The syntax must be exactly #@param {type:"string"}.
  • Check that #@param is on the same line as the variable assignment, after a space following the value.
  • Try refreshing the page and running the cell again. Colab sometimes needs a refresh to render new form fields.

Why aren't my Colab Forms fields showing up?

✔️ Awesome, I've got everything!

Great. Make sure you've saved your notebook with Cmd+S (macOS) or Ctrl+S (Windows).

ⓧ I'd like to double check the full code

Here is the complete Code Cell 1. Compare it character-for-character with what you typed:

#@title Client ROI & Pricing Tier Calculator
#@markdown Enter your client's details below.

client_name = 'Acme Corp' #@param {type:"string"}
project_value_text = '25000' #@param {type:"string"}
monthly_ops_spend_text = '8000' #@param {type:"string"}

print(f"Client data received for: {client_name}")
print(f"Project value (text): {project_value_text}")
print(f"Monthly spend (text): {monthly_ops_spend_text}")
print()
print(f"Type of project_value_text: {type(project_value_text)}")
print(f"Type of monthly_ops_spend_text: {type(monthly_ops_spend_text)}")
Cast text inputs into numbers

Your form fields deliver every value as text. The string '25000' looks like a number to you, but Python treats it as five characters. To do math on it, you need to cast it into a float (a decimal number) using float().

  • Add a new code cell below Code Cell 1 by clicking + Code.
  • Type the type casting code into the new cell:
# Type casting - converting text inputs to math-ready numbers
project_value = float(project_value_text)
monthly_ops_spend = float(monthly_ops_spend_text)

print(f"project_value: {project_value}")
print(f"Type after casting: {type(project_value)}")
print()
print(f"monthly_ops_spend: {monthly_ops_spend}")
print(f"Type after casting: {type(monthly_ops_spend)}")
print()

What is type casting?

Type casting is converting a value from one type to another. Here, float(project_value_text) takes the string '25000' and converts it into the decimal number 25000.0.

The result is stored in a new variable (project_value without _text) so you can tell at a glance which is the original string and which is the casted number.

Demonstrate why casting matters

What happens if you try to multiply a string by 2? Python won't give you an error. It will repeat the text instead of doubling the number. This subtle bug is why casting is essential.

  • Add the following code to the bottom of the same Code Cell 2 (below the print() on the last line):
# Why casting matters - string vs number multiplication
print("WITHOUT casting (string * 2):")
print(f"  '{project_value_text}' * 2 = '{project_value_text * 2}'")
print()
print("WITH casting (float * 2):")
print(f"  {project_value} * 2 = {project_value * 2}")

What should I see?

The first print shows '25000' * 2 = '2500025000'. Python repeated the text twice instead of doing math.

The second print shows 25000.0 * 2 = 50000.0. After casting to a float, Python correctly doubles the number. This is why you always need to cast form inputs before doing calculations.

  • Run Code Cell 2 by pressing Shift+Enter.
  • Confirm the output shows <class 'float'> for the casted values, and that the string multiplication produces 2500025000 while the float multiplication produces 50000.0.
  • Save the notebook with Cmd+S (macOS) or Ctrl+S (Windows).

Seeing a NameError?

  • Code Cell 2 depends on variables created in Code Cell 1. Make sure you ran Code Cell 1 first.
  • Check that the variable names match exactly: project_value_text and monthly_ops_spend_text. A single typo will cause a NameError.

Help me fix a NameError in my type casting cell.

✔️ Awesome, I've got everything!

Great. Double check you've saved your notebook.

ⓧ I'd like to double check the full code

Here is the complete Code Cell 2. Make sure both sections are in the same cell:

# Type casting - converting text inputs to math-ready numbers
project_value = float(project_value_text)
monthly_ops_spend = float(monthly_ops_spend_text)

print(f"project_value: {project_value}")
print(f"Type after casting: {type(project_value)}")
print()
print(f"monthly_ops_spend: {monthly_ops_spend}")
print(f"Type after casting: {type(monthly_ops_spend)}")
print()

# Why casting matters - string vs number multiplication
print("WITHOUT casting (string * 2):")
print(f"  '{project_value_text}' * 2 = '{project_value_text * 2}'")
print()
print("WITH casting (float * 2):")
print(f"  {project_value} * 2 = {project_value * 2}")

You now have an interactive form that collects client data and converts it into math-ready numbers. Next up, you'll use those numbers to calculate ROI and format a professional financial report.

Calculate ROI and Annual Savings

Your form is collecting client data and your numbers are cast from text into floats. Now it's time to put those numbers to work.

Python's math operators let you chain calculations together in just a few lines. In this step, you'll compute annual savings, ROI percentage, and payback period, then format everything into a professional financial report.

In this step, get ready to:
  • Calculate annual savings and ROI using math operators.
  • Format results into a branded financial summary report.
Add the ROI calculation formulas

Each financial metric builds on the previous one. You'll start with annual spend, then layer on savings, ROI percentage, and payback period.

  • Add a new code cell below Code Cell 2 by clicking the + Code button in the toolbar.
  • Type the following calculation code into the new cell:
# ROI Calculations
annual_ops_spend = monthly_ops_spend * 12
efficiency_rate = 0.30  # 30% operational savings from process improvements
annual_savings = annual_ops_spend * efficiency_rate
roi_percentage = (annual_savings / project_value) * 100
payback_months = project_value / (annual_savings / 12)

What does this code do?

  • annual_ops_spend multiplies monthly spend by 12 to get the full-year cost.
  • efficiency_rate is set to 0.30 (30%). This represents the assumed savings from process improvements.
  • roi_percentage divides savings by the project investment and multiplies by 100 to get a percentage.
  • payback_months divides the project cost by monthly savings to find how many months until the investment pays for itself.

You won't see any output yet. The next section adds print statements that display these values in a formatted report.

Format the results into a professional report

Raw numbers are hard to read. f-strings with format specifiers add dollar signs, commas, and decimal places so the output looks like a real financial document.

  • Add the following code directly below the calculation lines in the same cell:
# Financial Summary Report
print(f"{'=' * 50}")
print(f"  CLIENT ROI ANALYSIS")
print(f"{'=' * 50}")
print()
print(f"Client: {client_name}")
print(f"Project Investment: ${project_value:,.2f}")
print(f"Monthly Operational Spend: ${monthly_ops_spend:,.2f}")
print()
print(f"PROJECTED RETURNS")
print(f"{'-' * 30}")
print(f"Annual Operational Spend: ${annual_ops_spend:,.2f}")
print(f"Estimated Annual Savings (30%): ${annual_savings:,.2f}")
print(f"ROI: {roi_percentage:.1f}%")
print(f"Payback Period: {int(payback_months)} months")
print(f"{'=' * 50}")

What do the format specifiers do?

  • :,.2f formats a number with comma separators and 2 decimal places. So 25000.0 becomes 25,000.00.
  • :.1f gives 1 decimal place, perfect for a percentage like 115.2%.
  • int() truncates the decimal so payback months displays as a whole number.
  • '=' * 50 uses string multiplication to create a divider line of 50 equals signs.
  • Run the cell by clicking the play button on the left side of the cell (or press Shift+Enter).
  • You should see a formatted CLIENT ROI ANALYSIS report with dollar signs, commas, a percentage, and a payback period displayed as a whole number.

What should I see?

With the default form values (Acme Corp, 25000, 8000), your output should show a project investment of $25,000.00, annual savings of $28,800.00, ROI of 115.2%, and a payback period of 10 months.

  • To confirm the calculator actually responds to different inputs, go back to Code Cell 1 and change project_value_text to '50000'.
  • Re-run all cells from top to bottom using Runtime > Run all.
  • Your report numbers should change. The ROI drops and the payback period increases because the investment is larger.
  • Change project_value_text back to '25000' and re-run all cells before continuing.

Seeing a NameError?

If you see NameError: name 'monthly_ops_spend' is not defined, it means Code Cell 2 (type casting) hasn't been run yet. Run all cells above this one first.

If your dollar amounts show no commas or decimals, double check that you typed :,.2f inside the curly braces (the colon, comma, dot, 2, and f are all needed).

help me fix my ROI calculation cell

✔️ Awesome, I've got everything!

Great. Double check you've saved your notebook with Cmd+S (macOS) or Ctrl+S (Windows).

ⓧ I'd like to double check the full code

Here is the complete Code Cell 3. Make sure your cell matches this exactly:

# ROI Calculations
annual_ops_spend = monthly_ops_spend * 12
efficiency_rate = 0.30  # 30% operational savings from process improvements
annual_savings = annual_ops_spend * efficiency_rate
roi_percentage = (annual_savings / project_value) * 100
payback_months = project_value / (annual_savings / 12)

# Financial Summary Report
print(f"{'=' * 50}")
print(f"  CLIENT ROI ANALYSIS")
print(f"{'=' * 50}")
print()
print(f"Client: {client_name}")
print(f"Project Investment: ${project_value:,.2f}")
print(f"Monthly Operational Spend: ${monthly_ops_spend:,.2f}")
print()
print(f"PROJECTED RETURNS")
print(f"{'-' * 30}")
print(f"Annual Operational Spend: ${annual_ops_spend:,.2f}")
print(f"Estimated Annual Savings (30%): ${annual_savings:,.2f}")
print(f"ROI: {roi_percentage:.1f}%")
print(f"Payback Period: {int(payback_months)} months")
print(f"{'=' * 50}")

Your calculator now crunches numbers and displays a professional financial summary. Next up, you'll add conditional logic that automatically routes clients into pricing tiers based on their project value.

Assign Pricing Tiers with Conditional Logic

Your calculator already computes ROI and annual savings. But a real pricing tool needs to do more than show numbers. It needs to make a decision based on those numbers.

In this step, you will use if/elif/else conditional logic to automatically route clients into Silver, Gold, or Platinum discount tiers based on their project value. Python checks each condition in order and picks the first one that matches.

In this step, get ready to:
  • Write conditional logic to assign clients to Silver, Gold, or Platinum pricing tiers.
  • Calculate discount amounts and format a professional pricing recommendation report.
  • Document the Python concepts used throughout the notebook.
Write the pricing tier logic

Conditional logic lets your code make decisions. The if/elif/else pattern checks conditions from top to bottom and executes only the first matching block.

  • Add a new code cell below Code Cell 3 (your ROI calculations cell).
  • Add the following conditional logic that assigns clients to pricing tiers based on project_value:
# Pricing Tier Assignment
if project_value >= 50000:
    tier = "Platinum"
    discount = 0.20
    tier_benefit = "Priority support + 20% volume discount"
elif project_value >= 20000:
    tier = "Gold"
    discount = 0.10
    tier_benefit = "Dedicated account manager + 10% volume discount"
else:
    tier = "Silver"
    discount = 0.05
    tier_benefit = "Standard support + 5% volume discount"

What does this code do?

Python checks each condition in order. If project_value is 50,000 or more, it assigns Platinum and stops. It never checks the remaining conditions.

If the first condition is false, Python moves to elif and checks for 20,000+. The else block catches everything that didn't match above. Order matters because Python takes the first match.

You won't see output yet. The next chunk adds the formatted report that displays these tier values.

Calculate the discounted price and format the report
  • Below the tier assignment in the same code cell, add the price calculations and formatted report:
discounted_price = project_value * (1 - discount)
savings_from_discount = project_value - discounted_price

# Pricing Tier Report
print()
print(f"{'=' * 50}")
print(f"  PRICING TIER RECOMMENDATION")
print(f"{'=' * 50}")
print()
print(f"Client: {client_name}")
print(f"Assigned Tier: {tier}")
print(f"Benefits: {tier_benefit}")
print()
print(f"PRICING BREAKDOWN")
print(f"{'-' * 30}")
print(f"Standard Project Price: ${project_value:,.2f}")
print(f"Volume Discount ({int(discount * 100)}%): -${savings_from_discount:,.2f}")
print(f"Final Client Price: ${discounted_price:,.2f}")
print()
print(f"{'=' * 50}")
print(f"Generated by: Client ROI & Pricing Tier Calculator v1.0")
print(f"{'=' * 50}")

What does this code do?

  • discounted_price multiplies the project value by (1 - discount). For Gold, that is 25000 * 0.90 = 22500.
  • savings_from_discount is the dollar amount the client saves from their tier discount.
  • int(discount * 100) converts 0.10 into 10 so it displays as a clean percentage in the report.
  • Run the cell by pressing the play button or Shift+Enter.
  • You should see a formatted PRICING TIER RECOMMENDATION report showing Assigned Tier: Gold with a 10% volume discount applied (since the default project value is 25000).

Seeing a NameError?

If you see NameError: name 'project_value' is not defined, it means Code Cells 1 and 2 have not been run in this session. Run all cells above this one first (Runtime > Run before), then run Code Cell 4 again.

help me fix a NameError in my pricing tier code cell

✔️ Awesome, I've got everything!

Great. Double check you see Gold tier assigned with the default value of 25000.

ⓧ I'd like to double check the full code

Here is the complete Code Cell 4. Make sure your cell matches this exactly:

# Pricing Tier Assignment
if project_value >= 50000:
    tier = "Platinum"
    discount = 0.20
    tier_benefit = "Priority support + 20% volume discount"
elif project_value >= 20000:
    tier = "Gold"
    discount = 0.10
    tier_benefit = "Dedicated account manager + 10% volume discount"
else:
    tier = "Silver"
    discount = 0.05
    tier_benefit = "Standard support + 5% volume discount"

discounted_price = project_value * (1 - discount)
savings_from_discount = project_value - discounted_price

# Pricing Tier Report
print()
print(f"{'=' * 50}")
print(f"  PRICING TIER RECOMMENDATION")
print(f"{'=' * 50}")
print()
print(f"Client: {client_name}")
print(f"Assigned Tier: {tier}")
print(f"Benefits: {tier_benefit}")
print()
print(f"PRICING BREAKDOWN")
print(f"{'-' * 30}")
print(f"Standard Project Price: ${project_value:,.2f}")
print(f"Volume Discount ({int(discount * 100)}%): -${savings_from_discount:,.2f}")
print(f"Final Client Price: ${discounted_price:,.2f}")
print()
print(f"{'=' * 50}")
print(f"Generated by: Client ROI & Pricing Tier Calculator v1.0")
print(f"{'=' * 50}")
Document how the code works

Professional notebooks include documentation so anyone reading the code understands the techniques used. You will add two text cells that summarize the Python concepts and key takeaways.

  • Add a new text cell below Code Cell 4.
  • Paste the following markdown into the text cell:
## How This Code Works

- **Type Casting** (`float()`) converts text form inputs into decimal numbers that Python can do math with.
- **Math Operators** (`*`, `/`, `-`) calculate annual spend, savings, ROI percentages, and discount amounts.
- **Conditional Logic** (`if/elif/else`) routes clients to different pricing tiers based on their project value.
- **f-strings** with format specifiers (`:,.2f`) add dollar signs, commas, and decimal places for professional output.
  • Add another text cell below Text Cell 3.
  • Paste the following markdown into this new text cell:
## Key Takeaways and Next Steps

**What I built today:**
A Client ROI & Pricing Tier Calculator that converts text inputs to numbers, computes financial metrics, and automatically assigns clients to discount tiers.

**Python skills I used:**
- `float()` and `int()` to cast text into math-ready numbers
- `*`, `/`, `-` operators for financial calculations
- `if/elif/else` to route clients to pricing tiers
- Colab Forms (`#@param`) for a clean input dashboard

**Next up (Day 3):**
Adding data validation and error handling to make your tools bulletproof.

Why document your notebook?

These text cells turn your notebook into a portfolio piece. Anyone opening it (a hiring manager, a teammate, or future-you) can immediately understand what was built and which skills were used without reading every line of code.

  • Run all cells from top to bottom by clicking Runtime > Run all.
  • Confirm that both the CLIENT ROI ANALYSIS report and the PRICING TIER RECOMMENDATION report display without errors.
  • Now test that the conditional logic works. Scroll up to Code Cell 1 and change project_value_text to '55000'.
  • Click Runtime > Run all again. The report should now show Assigned Tier: Platinum.
  • Change project_value_text to '10000' and run all again. You should see Assigned Tier: Silver.

Reset your default values

After testing, change project_value_text back to '25000' so the notebook displays Gold tier as the default example when others open it.

🙋‍♀️ Tier not changing when you update the value?

Make sure you are running all cells after changing the value in Code Cell 1. If you only re-run Code Cell 4, it still uses the old project_value from the previous run. Use Runtime > Run all to refresh everything from the top.

help me debug why my pricing tier isn't updating

  • Save your notebook with Cmd+S (macOS) or Ctrl+S (Windows).

Your calculator now makes automated pricing decisions. Next up, you will publish this notebook to GitHub and add a clickable badge so anyone can run your tool instantly.

Publish to GitHub with an Open in Colab Badge

Your calculator is complete. It collects client details, casts text into numbers, computes ROI, and assigns pricing tiers automatically.

A tool nobody can access is a tool nobody uses. In this step, you'll publish your notebook to GitHub and add an "Open in Colab" badge so anyone can click a single button and run your calculator instantly.

In this step, get ready to:
  • Save your notebook to the python-portfolio GitHub repository.
  • Add a clickable Open in Colab badge to your README.
  • Test the badge to confirm anyone can open and run your calculator.
Save your notebook to GitHub

Google Colab has a built-in feature that saves your notebook directly into a GitHub repository as a commit. This is the same workflow you used on Day 1.

  • In your Colab notebook, click File in the top menu bar.
  • Click Save a copy in GitHub.
  • In the dialog that appears, select your python-portfolio repository from the Repository dropdown.
  • Keep the branch set to main.
  • In the Commit message field, type Add Day 2 Client ROI & Pricing Tier Calculator notebook.
  • Click OK to save.

What does this do?

This creates a new commit in your GitHub repository containing the full notebook file. Anyone who visits your repository will see Day_2_Client_ROI_Pricing_Tier_Calculator.ipynb listed alongside your Day 1 notebook.

  • Open your python-portfolio repository on GitHub in a new tab.
  • Confirm that Day_2_Client_ROI_Pricing_Tier_Calculator.ipynb appears in the file list.

Don't see the notebook file?

Make sure you selected the correct repository (python-portfolio) in the save dialog. If you accidentally saved to a different repository, repeat the steps above with the correct one selected.

If Colab asks you to authorize GitHub access, follow the prompts to grant permission, then try saving again.

Help me save my Colab notebook to GitHub

Add an Open in Colab badge to your README

An Open in Colab badge is a clickable button that launches your notebook in a fresh Colab session. Anyone who clicks it can run your calculator without downloading anything.

  • On your python-portfolio repository page, click the README.md file.
  • Click the pencil icon (edit button) in the top-right corner of the file view.
  • At the bottom of the existing README content, add the following badge markdown:
## Day 2: Client ROI & Pricing Tier Calculator

[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/[[GITHUB_USERNAME="your GitHub username"]]/python-portfolio/blob/main/Day_2_Client_ROI_Pricing_Tier_Calculator.ipynb)

What does this badge code do?

This markdown creates a clickable image badge. The first URL (colab-badge.svg) is Google's official badge graphic. The second URL tells Colab which notebook to open from your GitHub repository.

Replace the username placeholder with your actual GitHub username so the link points to your notebook.

  • Click Commit changes (the green button).
  • In the commit dialog, keep the default message and click Commit changes again to confirm.

Navigate back to the main repository page. You should see the badge rendered as a clickable button under the "Day 2" heading in your README.

Badge not rendering as a button?

Check that the markdown uses the exact bracket and parentheses pattern shown above. A missing closing bracket or parenthesis will break the image link.

Make sure you replaced the username placeholder with your actual GitHub username (case-sensitive).

Help me fix my Open in Colab badge

Test the badge

The final check is making sure the badge actually works. If the link has a typo in your username or filename, it will fail silently.

  • On your repository's main page, click the Open in Colab badge button in the README.
  • Confirm that a new Colab tab opens with your Day_2_Client_ROI_Pricing_Tier_Calculator.ipynb notebook loaded.
  • Verify that the form fields appear on the right side of Code Cell 1 and that you can run the full notebook from top to bottom.

Badge opens a "File not found" page?

Double-check that your notebook filename on GitHub is exactly Day_2_Client_ROI_Pricing_Tier_Calculator.ipynb (with underscores, not spaces). The URL in the badge must match the filename character for character.

Also confirm that the branch in the URL is main and that your GitHub username is spelled correctly.

Help me troubleshoot my Open in Colab link

Your pricing calculator is now live on GitHub with a one-click launch button. Anyone who visits your portfolio can open the tool and run it without installing anything. Next up, you'll take on a bonus challenge that processes multiple clients at once.

Secret mission

Multi-Client Comparison Report

Your calculator works great for one client at a time. But what if you need to compare pricing across multiple clients in a single report? In this secret mission, you'll use Python lists and a for loop to process three clients in one pass and generate a formatted comparison.

Clean Up Your Resources

Clean Up Your Resources

This project runs entirely on free services, so there are no ongoing costs. Your notebook is stored in Google Drive and your repository is hosted on GitHub, both at no charge.

Resources you used:

  • Day_2_Client_ROI_Pricing_Tier_Calculator.ipynb notebook in Google Drive (free, no ongoing cost).
  • Updated python-portfolio repository on GitHub (free, no ongoing cost).

Decide whether to keep your resources running, pause them to come back later, or delete them entirely.

Keep everything running

No action needed. Choose this if you plan to continue building on your Python portfolio.

  • Your notebook stays in Google Drive and is accessible anytime from colab.research.google.com.
  • Your GitHub repository remains live with the Open in Colab badge active for anyone to use.
  • Both services are free. Nothing will incur charges.

Pause - I'll come back to this later

Shut down the running session to free up resources. Your files remain saved in Drive and GitHub.

  • Close the Google Colab browser tab. Your notebook is already saved.
  • To reopen later, visit Google Drive or your GitHub repository and click the Open in Colab badge.

Delete - I don't want to use this again

Remove all project resources and start fresh. This cannot be undone.

Remove the notebook from Google Drive:

  • Open drive.google.com in your browser.
  • Navigate to the Colab Notebooks folder.
  • Right-click Day_2_Client_ROI_Pricing_Tier_Calculator.ipynb and select Move to trash.

Remove the Day 2 file and badge from your GitHub repository:

  • Open your python-portfolio repository on GitHub.
  • Click Day_2_Client_ROI_Pricing_Tier_Calculator.ipynb in the file list.
  • Click the ... menu in the top-right corner of the file view, then click Delete file.
  • Click Commit changes to confirm the deletion.
  • Navigate back to the repository, click README.md, then click the pencil icon to edit.
  • Delete the Day 2 heading and the Open in Colab badge line you added earlier.
  • Click Commit changes to save.

That's a Wrap!

That's a Wrap!

Nice work! You just built a professional Client ROI & Pricing Tier Calculator that automates real business decisions using Python.

You've learned how to:

  • Built a Client ROI & Pricing Tier Calculator that uses type casting, math operators, and conditional logic to convert text inputs into numbers, compute financial metrics, and assign pricing tiers automatically.
  • Created an interactive Colab Forms dashboard with formatted financial reports using f-string format specifiers for dollar signs, commas, and percentages.
  • Published the notebook to GitHub with an Open in Colab badge so anyone can click and run your tool instantly.
  • Secret Mission: Built a multi-client comparison using lists and a for loop to process multiple clients in one pass and output a ranked pricing report.

Ready to quiz yourself?