Both will make it hard for you to get certain types of exercise. Your doctor probably told you the irregular heartbeat represented an increased risk of heart attack
. It means you will need exercise that does not involve your being on your feet a long time; walking or running, for example. And you do not want to be too aerobic about it.
Yes, you can exercise, but you will need to take longer and do gentler exercises. For example, you may walk slower, stop at park benches more often, but if you take the extra time, you will still get good exercise.