from scipy.optimize import linprog c = [-100, -125] A = [[3, 6], [8, 4]] b = [30, 44] bound = (0, None) res = linprog(c, A_ub=A, b_ub=b, bounds=[bound, bound], method='highs') #print solution print(f'Optimal solution: G = {res.x[0]:.2f}, H = {res.x[1]:.2f}') print(f'Maximum profit = $ {-res.fun:.2f}')