## Problem Description and Formulation

The electronics store sells two types of web-cams: a standard definition (SD) web-cam and a high definition (HD) web-cam. The cost and profit of each type are as follows:

- SD web-cam: Cost = $150, Profit = $100
- HD web-cam: Cost = $250, Profit = $125

The store has two main constraints:
1. The total investment in web-cam inventory should not exceed $40,000.
2. The total monthly demand for web-cams is at most 275 units.

The goal is to determine the number of each type of web-cam to stock in order to maximize profit, subject to these constraints.

## Mathematical Formulation

Let's denote:
- \(x\) as the number of SD web-cams to stock,
- \(y\) as the number of HD web-cams to stock.

The objective function to maximize profit is:
\[ \text{Maximize:} \quad 100x + 125y \]

Subject to:
1. Investment constraint: \( 150x + 250y \leq 40000 \)
2. Demand constraint: \( x + y \leq 275 \)
3. Non-negativity constraints: \( x \geq 0, y \geq 0 \) and \( x, y \) are integers (though Gurobi can handle continuous variables, we'll ensure integrality as it's a requirement for the number of items).

## Gurobi Code

```python
import gurobi

def optimize_web_cam_inventory():
    # Create a new model
    model = gurobi.Model()

    # Define variables: number of SD and HD web-cams
    x = model.addVar(name="SD_web_cams", lb=0, vtype=gurobi.GRB.INTEGER)
    y = model.addVar(name="HD_web_cams", lb=0, vtype=gurobi.GRB.INTEGER)

    # Objective function: Maximize profit
    model.setObjective(100*x + 125*y, gurobi.GRB.MAXIMIZE)

    # Investment constraint
    model.addConstr(150*x + 250*y <= 40000, name="investment_constraint")

    # Demand constraint
    model.addConstr(x + y <= 275, name="demand_constraint")

    # Optimize
    model.optimize()

    # Print solution
    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal solution: SD web-cams = {x.varValue}, HD web-cams = {y.varValue}")
        print(f"Max Profit: ${model.objVal}")
    else:
        print("No optimal solution found")

optimize_web_cam_inventory()
```

This code sets up a Gurobi model for the given problem, solves it, and prints out the optimal number of each type of web-cam to stock and the maximum achievable profit. If no optimal solution is found (for example, if the problem is infeasible), it will indicate that as well.