## Problem Description and Formulation

The problem is a linear programming optimization problem. The goal is to minimize the total cost of producing backpacks and handbags under certain constraints.

### Decision Variables
- Let \(B\) be the number of backpacks produced.
- Let \(H\) be the number of handbags produced.

### Objective Function
The objective is to minimize the total cost of production. Given that the cost for producing a backpack is $5 and for producing a handbag is $8, the objective function can be formulated as:
\[ \text{Minimize:} \quad 5B + 8H \]

### Constraints
1. **Machine Operation Time**: The machine must be operated for at least 3000 minutes per week. Each backpack takes 20 minutes, and each handbag takes 15 minutes on the machine. Therefore, the constraint can be written as:
\[ 20B + 15H \geq 3000 \]

2. **Minimum Production**: The factory must make a minimum of 180 items total. This can be represented as:
\[ B + H \geq 180 \]

3. **Non-Negativity**: The number of backpacks and handbags produced cannot be negative:
\[ B \geq 0, H \geq 0 \]

## Gurobi Code

```python
import gurobi

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

    # Define the decision variables
    B = model.addVar(lb=0, name="Backpacks")
    H = model.addVar(lb=0, name="Handbags")

    # Objective function: Minimize production cost
    model.setObjective(5 * B + 8 * H, gurobi.GRB.MINIMIZE)

    # Constraints
    model.addConstr(20 * B + 15 * H >= 3000, name="Machine_Time")
    model.addConstr(B + H >= 180, name="Minimum_Production")

    # Solve the model
    model.optimize()

    # Check if the model is optimized
    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal Solution: Backpacks = {B.varValue}, Handbags = {H.varValue}")
    else:
        print("The model is infeasible.")

solve_production_problem()
```

This code defines the optimization problem using Gurobi's Python interface, sets up the objective function and constraints according to the problem description, and solves the linear programming problem to find the optimal production levels for backpacks and handbags that minimize costs.