In case of expansion, work is done by system.
Now, as we know that,
W=−Pext.ΔV
As the gas is expanding into vacuums which has no pressure, i.e.,
Pext.=0
∴W=0
Hence, no work is done.
From first law of thermodynamics,
ΔU=q+W
As the system is working at constant temperature, i.e., isothermally.
∴ΔU=0
Hence q=−W=0