Give in brief O2is paramagnetic and N2 is diamagnetic.
N2 is diamagnetic:-
σ1s2σ∗1s2σ2s2σ∗2s2π2px2π2py2σ2pz2
O2is paramagnetic:-
σ1s2σ∗1s2σ2s2σ∗2s2σ2pz2π2px2π2py2π∗2px1π2py1
Therefore, O2 is paramagnetic and N2 is diamagnetic in nature.