Electrical resistivity rho of zirconium hydrides ZrHx and deuterides ZrDx has been measured over the range of hydrogen concentration 0 less than or equal to x < 0.9 (x: H/Zr or D/Zr) and temperature 700 K less than or equal to T less than or equal to 1100 K. It has been found that rho increases linearly with x in the alpha phase and exhibits a parabolic change in the beta phase, shows almost no difference for H and D in the range 0 less than or equal to x < 0.9 and deviates from Matthiessen's rule in the alpha phase. To help discuss the findings, we have made energy band calculations of ZrHx and computed quantities that are closely related to rho. The observed change in rho with x can be explained by assuming that H atoms form independent electron scatterers in the alpha phase and H atom vacancies additionally form electron scatterers in the beta phase. The lack of difference observed in rho for H and D can be explained by the fact that electron-optical phonon coupling constant obtained from the energy band calculations is much smaller than the electron-acoustic phonon coupling constant. It is difficult to give a reasonable explanation of the deviation from Matthiessen's rule only by the energy band calculation result.