city=["A","B"] week=[0,1,2,3] S={"A":[5,15,25,35], "B":[80,11,31,30]} model=gp.Model() I = model.addVars(city, week, name="I") model.setObjective(...) # try 1: model.addConstrs(S[c][w] <= I[c][w] for c in city for w in week) # try 2: for c in city: for w in week: model.addConstr(S[c][w] <= I[c][w]) Hello, I am trying to solve a problem and I need to add a constraint for each city and for each week. However, I get a "SyntaxError: invalid syntax" for the for loop when trying to add the constraint. Could you help me I am not sure how to correctly add them?