The correct option is D Liquid O2 will be attracted, but liquid N2 will be repelled
In O2 molecule, the antibonding π∗2px and π∗2py orbitals are singly occupied and hence it is paramagnetic in nature and is attracted to the electromagnet.
Whereas in N2, the σ 2pz is fully occupied and hence N2 is diamagnetic and is repelled by the electromagnet.