Final answer:
Carbon, which is a group 14 element, contains four valence electrons.
Step-by-step explanation:
The element that contains four valence electrons is carbon. It belongs to group 14 of the periodic table, which is characterized by elements having four valence electrons. This is consistent with the electron configuration of carbon, which is 1s2 2s2 2p2. In contrast, nitrogen, as a group 15 element, has five valence electrons; oxygen, a group 16 element, has six valence electrons; and fluorine, a group 17 element, has seven valence electrons. These valence electron counts are crucial for predicting bonding patterns and chemical reactivity.