Let's start by saying anything is better than not at all.
It really depends on your very specific goals, e.g. do you mean cardiovascular shape or swimming shape? If you raise your pulse to your personal target pulse and keep it there for 40 minutes three times a week this should be pretty good for getting you in shape.
When I trained with a group of armatures, but with a trainer, we used to swim twice a week, about 3 km each session, but on different styles and times, including only legs, only hands, with flippers, with hand flippers, sprints, easy and long distance (up to 1 km without stopping). The more serious among us added another session per week. This made me improve a lot, especially in my swimming capabilities.
I currently swim one km three times a week, not too quick but raising my pulse above 60% of my max pulse, and I feel it keeps me levelled (but not really improving) as far as swimming capabilities go but doesn't stop my cardiovascular deterioration...
I am really not an expert on the subject, but after about 20 years of doing light endurance training in many disciplines I feel the most important thing is to find a level and an arrangement which you can keep for a long time, i.e. don't go too hard on yourself or you're bound to hate it after three months and stop.