Can you help me check and debug the code for Codercise HS 2.2

My SELECT circuit isn’t quite right. Can you please check what I did wrong and help me debug my code.

def my_select(U_list):
      k = len(U_list)
      n = int(np.log2(k))
      m = int(np.ceil(np.log2(k)))
      control_wires = list(range(m))
      target_wires = list(range(m, m + n))
      if m == 0:
            qml.QubitUnitary(np.array(U_list\[0\]),  wires=target_wires)
       else:
            for i in range(k):
            bin_str = np.binary_repr(i, width=m)
            U_matrix = np.array(U_list\[i\])
            qml.ControlledQubitUnitary(U_matrix, control_wires=control_wires, wires=target_wires,      control_values=bin_str)

hi!
please check that the control values are in the correct format. I mean your variable bin_str has to be in the right format. An example of correct format is control_values=[0, 1, 1]

Thanks, I think I used this.

[int(bit) for bit in bin_str]