Working with chains

Good afternoon, how can I enter the circuit numbers into the parameter I need?

pyreviters,tell me,please, is the logic of the code correct? first we must get the elements of the circuit numbers and then set the values ​​in our desired parameter.