Gaining weight despite exercise

Patient: Ok just a little back story, Ive always been a fat kid growing up I would say around the age of 18 I started to work out and lost tons of weight, after some time I managed to get down to 170 pounds from 280 (im 6’0 ft btw). I managed to keep the weight off for the most part until I turned 25 and noticed my weight has been going up since even though I never stopped going to the gym, I work out 5-6 days a week. About five months ago in addition to working out I bought a stationary bike so I can ride that at home while I watch tv and usually ride that for over an hour everyday. Despite all this im still gaining weight, as I type this im 240 pounds and I just dont understand it. I dont smoke, I havent drank an ounce of alcohol in 5 years, I limit my fast food intake to at least 1 day a week, and I drink water all day everyday since i was 20 including meals. I dont get it at all. Im looking for answers and im open to any suggestions as to what it could be, im also going to go to the doctor and would like to know what questions I should ask, thanks in advance

Doctor: Thank you for your question. The reason you may continue to be gaining weight even though you are exercising regularly a nd eating well, is that you could have become accustomed to the type of workout and diet plan you are engaging in, and you are no longer burning enough calories a day for weight loss. In order to lose one pound of fat you need to burn 3500 calories. We recommend that you change the type of exercises that you are doing to something new, like swimming. We also recommend that you consult a dietician in order to design a meal guide catered to your needs and personal weight loss goals. Your weight gain may also be due to hormonal imbalances within your body. We recommend that you see you doctor to have a complete physical exam, and blood work. Make sure your doctor does a thyroid function test, as slight alterations in thyroid hormones can result in weight gain.Thank you for choosing