We investigate by means of Monte Carlo simulations the zipping and unzipping dynamics of two polymers connected at one end and subject to an attractive interaction between complementary monomers. In zipping, the polymers are quenched from a high temperature equilibrium configuration to a low temperature state, such that the two strands zip up by closing up a 'Y'-fork. In unzipping, the polymers are brought from a low temperature double-stranded configuration to high temperatures, such that the two strands separate. Simulations show that the unzipping time, tau(u), scales as a function of the polymer length as tau(u) similar to L, while the zipping is characterized by the anomalous dynamics tau(z) similar to L-alpha with alpha = 1.37(2). This exponent is in good agreement with simulation results and theoretical predictions for the scaling of the translocation time of a forced polymer passing through a narrow pore. We find that the exponent a is robust against variations of parameters and temperature, whereas the scaling of tau(z) as a function of the driving force shows the existence of two different regimes: the weak forcing (tau(z) similar to 1/F) and strong forcing (tau(z) independent of F) regimes. The crossover region is possibly characterized by a non-trivial scaling in F, matching the prediction of recent theories of polymer translocation. Although the geometrical setups are different, zipping and translocation share thus the same type of anomalous dynamics. Systems where this dynamics could be experimentally investigated include DNA (or RNA) hairpins: our results imply an anomalous dynamics for the hairpins' closing times, but not for the opening times.