Answer
(a) 6 electrons
(b) 6 electrons
Work Step by Step
(a) We know that 2p has such an electronic configuration that $2p_x,2p_y$ and $2p_z$ each can occupy 2 electrons. Thus, 2p subshell has total 6 electrons.
(b) 3p is further divided into $3p_x,3p_y$ and $3p_z$ and each of them can have 2 electrons. Hence, 3p can occupy 6 electrons.