<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Introduction to Linear Programming with Python - Part 2
Introduction to PuLP
PuLP is an open source linear programming package for python. PuLP can be installed using pip, instructions here.
In this notebook, we'll explore how to construct and solve the linear programming problem described in Part 1 using PuLP.
A brief reminder of our linear programming problem
Step1:  Then instantiate a problem class, we'll name it "My LP problem" and we're looking for an optimal maximum so we use LpMaximize
Step2:  We then model our decision variables using the LpVariable class. In our example, x had a lower bound of 0 and y had a lower bound of 2.
Upper bounds can be assigned using the upBound parameter.
Step3:  The objective function and constraints are added using the += operator to our model. 
The objective function is added first, then the individual constraints.
Step4:  We have now constructed our problem and can have a look at it.
Step5:  PuLP supports open source linear programming solvers such as CBC and GLPK, as well as commercial solvers such as Gurobi and IBM's CPLEX.
The default solver is CBC, which comes packaged with PuLP upon installation.
For most applications, the open source CBC from COIN-OR will be enough for most simple linear programming optimisation algorithms.
Step6:  We have also checked the status of the solver, there are 5 status codes
<ASSISTANT_TASK:>
Python Code:
import pulp
Explanation: Introduction to Linear Programming with Python - Part 2
Introduction to PuLP
PuLP is an open source linear programming package for python. PuLP can be installed using pip, instructions here.
In this notebook, we'll explore how to construct and solve the linear programming problem described in Part 1 using PuLP.
A brief reminder of our linear programming problem:
We want to find the maximum solution to the objective function:
Z = 4x + 3y
Subject to the following constraints:
x ≥ 0
  y ≥ 2
  2y ≤ 25 - x
  4y ≥ 2x - 8
  y ≤ 2x - 5  
We'll begin by importing PuLP
End of explanation
my_lp_problem = pulp.LpProblem("My LP Problem", pulp.LpMaximize)
Explanation: Then instantiate a problem class, we'll name it "My LP problem" and we're looking for an optimal maximum so we use LpMaximize
End of explanation
x = pulp.LpVariable('x', lowBound=0, cat='Continuous')
y = pulp.LpVariable('y', lowBound=2, cat='Continuous')
Explanation: We then model our decision variables using the LpVariable class. In our example, x had a lower bound of 0 and y had a lower bound of 2.
Upper bounds can be assigned using the upBound parameter.
End of explanation
# Objective function
my_lp_problem += 4 * x + 3 * y, "Z"
# Constraints
my_lp_problem += 2 * y <= 25 - x
my_lp_problem += 4 * y >= 2 * x - 8
my_lp_problem += y <= 2 * x - 5
Explanation: The objective function and constraints are added using the += operator to our model. 
The objective function is added first, then the individual constraints.
End of explanation
my_lp_problem
Explanation: We have now constructed our problem and can have a look at it.
End of explanation
my_lp_problem.solve()
pulp.LpStatus[my_lp_problem.status]
Explanation: PuLP supports open source linear programming solvers such as CBC and GLPK, as well as commercial solvers such as Gurobi and IBM's CPLEX.
The default solver is CBC, which comes packaged with PuLP upon installation.
For most applications, the open source CBC from COIN-OR will be enough for most simple linear programming optimisation algorithms.
End of explanation
for variable in my_lp_problem.variables():
    print "{} = {}".format(variable.name, variable.varValue)
print pulp.value(my_lp_problem.objective)
Explanation: We have also checked the status of the solver, there are 5 status codes:
* Not Solved: Status prior to solving the problem.
* Optimal: An optimal solution has been found.
* Infeasible: There are no feasible solutions (e.g. if you set the constraints x <= 1 and x >=2).
* Unbounded: The constraints are not bounded, maximising the solution will tend towards infinity (e.g. if the only constraint was x >= 3).
* Undefined: The optimal solution may exist but may not have been found.
We can now view our maximal variable values and the maximum value of Z. 
We can use the varValue method to retrieve the values of our variables x and y, and the pulp.value function to view the maximum value of the objective function.
End of explanation
<END_TASK>