Doubt on weights

Inside the loop for training 100 epochs , we always reset the values to zero,
how come when we print the weights at the end, we get the values.This is a foolish doubt I know,anyone kindly reply??