I wonder I can improve my python code to be written shorter. I only use standard library and numpy library. Here is the code.
import numpy as np
x=1
y=2
np.array([(a,b,c) for a in [x,y] for b in [x,y] for c in [x,y]])
As you can see, this program produces all three combinations of elements.
There is a similar part in this program like for a in [x, y]
and can it be written shorter?
[Edited]
I want to use only standard library and numpy library.
The inputs should be any values like x=3, y=8.