Why do all the elements of the (a) Same group have similar properties, (b) Same period have different properties?

Why do all the elements of the
(a) Same group have similar properties,
(b) Same period have different properties?

(a) Elements in the same group have similar properties because they have the same number of valence electrons in their outermost shell.

(b) Elements in the same period have different properties because the numbers of valence electrons in their outermost shells differ.