Create a variable containing multiple values in Pulp - Python Snippets - Snipit

PHOTO EMBED

Sun Jul 10 2022 05:54:42 GMT+0000 (Coordinated Universal Time)

Saved by @nilotpalc #python

flows = LpVariable.dicts('flows',keys,cat='Integer') # the number of values are included in the list keys and of type integer
open_w = LpVariable.dicts('open_w',distmatrix.index,cat='Binary') # the number of values are included in the list generated by tolist method and of type binary
content_copyCOPY

https://snipit.io/