I had one that didn't mind it. She would swish around a bit, and then just float. Another doesn't like it, but sometimes she has no choice.
The trick is to make sure the water is not too hot (remember, if it's warm to you it's close to body temperature: 98.6* which is too hot for snakes) and make sure there is not too much water. It should only come half way up their bodies. For most snakes that's only about an inch of water.
They can swim, but it's tiring. Try not to stress them out.