How to change tray widths automatically?

Greetings, I have a problem when making this script, I have several trays with different widths that are represented with codes, for example, if it is 100mm wide the tray has a TJ code, if it is 200mm, it is TK.
The final revision has already been done and I have to change the widths according to the codes, for example I have 200mm trays but in the code it is TJ, so that tray must be changed to 100, how can I fix the script?
The codes are TJ=100, TK=200, TL=300, TM=400, TN= 500, BJ=100, BK=200, BL=300, BM=400, BN= 500

Look into dictionaries - that’s exactly what you’re dealing with. You have a key (the code) and the value (the width) you want to use based on that key. Build a dictionary of codes and widths and then get the correct width for each element based on its code.