How can I store the text version of a constraint defined as a docplex.mp.linear.LinearExpr variable into a Python string variable?
Use its string representation as returned by str(ct).
nbbus50 = mdl.integer_var(name='nbBus50')
nbbus40 = mdl.integer_var(name='nbBus40')
nbbus30 = mdl.integer_var(name='nbBus30')
ct1 = nbbus50 * 50 + nbbus40 * 40 + nbbus30 * 30 >= 200
print(f"str(ct1)= {str(ct1)}")
str(ct1)= 50nbBus50+40nbBus40+30nbBus30 >= 200