No, you should not have sex! Physical exertion definitely includes sex and you must avoid all exercise, sex, lifting of objects, etc until cleared by your doctor
. The reason that your doctor told you this is that the incision on your abdomen needs time to heal. If you have sex or engage in other physical activity, you run the risk of putting to much stress on the delicate new tissue, which could lead to a bad scar or, worse still, rupture of the incision or return of the hernia.
I strongly recommend that you not engage in any physical activity until you have seen your surgeon
back again for the followup visit, which usually occurs at about 1 month or 6 weeks after the surgery
. At this visit, the surgeon will be able to take a look at the incision and make sure that it has healed properly. If so, they will then be able to recommend for you how you can resume physical activity. Even after this, you will still want to proceed slowly with increasing levels of physical activity. At least however, it should be ok to have sexual intercourse at this point, once you have been cleared by your doctor.