We show that for the edge ideals of the graphs consisting of one cycle or two cycles of any length connected through a vertex, the arithmetical rank equals the projective dimension of the corresponding quotient ring.