I recently got a pack of different value resistors, but some of them were zero ohms. Is there any purpose in using 0 ohm resistors?
Yes, zero Ohm “resistors” are very useful. When strategically place within a design and board layout, they can be used to enable or disable specific circuit options. You can really think of them as semi-permanent switches. When they are not soldered into the circuit, the circuit is broken and not enabled. When they are soldered into place, they allow current to flow through and enabling the circuit option.
For example, you may want the option of a general purpose output pin from a microcontroller to light an LED, or enable a motor. Using zero Ohm resistors in strategic places you can remove a resistor to disable ability for the microcontroller to enable the motor drive transistor, and place a resistor to enable the microcontroller to drive the LED transistor. Reciprocally, you can place the resistor to enable the motor drive transistor and remove the ability to drive the LED.
This is usually done to allow flexibility in the use of the PCB, or for experimental circuits. Their use can prevent the costly need of building multiple boards with only very slight differences.
Yes, they have multiple purposes.
They can be used for configuring one board between options.
They are also useful when a signal needs to jump over tracks to for example keep a PCB design single sided.
And sometimes, a PCB can be designed without knowing if a resistor is needed or not, so a place for it is drawn and it can be replaced with other value in production if necessary.