Why should a swimmer leave the water if they see jellyfish close to shore?

Jellyfish that are close to shore should not necessarily pose a threat to swimmers, and there are numerous species that are harmless. However, it is advisable for swimmers to avoid contact with jellyfish, regardless of their proximity to shore, due to the potential risks associated with their stings. Some jellyfish, like the box jellyfish and Portuguese man o' war, possess venomous tentacles that can inflict painful, and even life-threatening stings, even when their bodies are washed ashore.

Therefore, it is generally recommended that swimmers exercise caution when encountering jellyfish, irrespective of their location, and take appropriate measures to avoid contact with these marine creatures.