How can I dynamically set checkboxes to be named variables? If I have a field of checkboxes, I'd like to be able to access them by the name of each checkbox as the variable name, and the 0 or 1 checked state as the value. Said variables need to be accessible beyond the for loop.

For example (doesn't work):

{% for checkbox in checkboxes %}
    {% set {{ checkbox }} = checkbox.selected %}
{% endfor %}


I've looked into things and seen answers mentioning _context, attribute(), and the like, but haven't been able to get anything to work.

In short, if I have a checkboxes field with a single checkbox whose name is my_checkbox, label is "My Checkbox", and is checked in an entry, I'd like to be able to use {{ my_checkbox }} to output "1" (i.e. it's checked).
So I had missed the entry.checkboxFieldHandle.contains('tequila') line in the docs, which allows me to access the checkbox values outside the for loop.