Why Do Fish Keep Moving Their Tails from Side to Side?

Swimming in water, a fish's tail functions as a boat's oar and helm. When a fish wants to turn to the right, it moves its tail towards the left; when a fish wants to turn to the left, it moves its tail towards the right. Fish also depends on its tail t6 move forward. Without tails fish wouldn't be able to swim.