Consult a fitness instructor and doctor.
The doctor's words are right, swimming is a very good one among all aerobic exercises, because swimming has the least burden on joints, is the best for people with bone and joint injuries, is conducive to recovery, and consumes fat faster. As for whether you can learn to swim, it is normal for a talented person to learn to swim for a while. Few people can learn to swim at once. Generally, you can swim slowly by yourself after studying for a month. After all, you can't eat hot tofu in haste. Take your time. As for what other sports you can do, you'd better ask the doctor. Preferably a professional. After all, it's hard to give any good advice based on what you said. If you give the wrong advice, it may delay your life, so you'd better ask a doctor.