Here's the formulation of the linear program and the Gurobi code to solve it:

**Decision Variables:**

* `x`: Number of tennis rackets produced
* `y`: Number of badminton rackets produced

**Objective Function:**

Maximize profit: `20x + 17y`

**Constraints:**

* Molding time: `12x + 10y <= 3000`
* Stringing time: `15x + 12y <= 3500`
* Non-negativity: `x >= 0`, `y >= 0`


```python
import gurobipy as gp

# Create a new model
model = gp.Model("RacketProduction")

# Create decision variables
x = model.addVar(lb=0, vtype=gp.GRB.CONTINUOUS, name="tennis_rackets")
y = model.addVar(lb=0, vtype=gp.GRB.CONTINUOUS, name="badminton_rackets")

# Set objective function
model.setObjective(20 * x + 17 * y, gp.GRB.MAXIMIZE)

# Add constraints
model.addConstr(12 * x + 10 * y <= 3000, "molding_constraint")
model.addConstr(15 * x + 12 * y <= 3500, "stringing_constraint")

# Optimize model
model.optimize()

# Print results
if model.status == gp.GRB.OPTIMAL:
    print(f"Optimal Solution Found:")
    print(f"Number of Tennis Rackets: {x.x}")
    print(f"Number of Badminton Rackets: {y.x}")
    print(f"Maximum Profit: ${model.objVal}")
elif model.status == gp.GRB.INFEASIBLE:
    print("The model is infeasible.")
else:
    print(f"Optimization terminated with status {model.status}")

```
