z=[var(f'p_{k}{l}') for k in range(2) for l in range(4)]

I can easily print z[6]. But what I want to use is it's two indices. How can I recover them ?