So I wrote few conditions
keys=[\'a\',\'b\',\'c\'] var=LpVariable.dicts(\'var\',(keys,[1,2,3]),cat=\'Binary\') for key in keys: prob+=lpSum([var[key][j] f