How long ago was surgery?
My dad has quad about ten years ago, I'm sure he could do karate now, but I know the first year it would have been dumb, he was holding a pillow to his chest for months.
The thing is, ifnyou had heart surgery and your not seeing a heart docter then it's probably a bad idea.
If your looking for excersize and something that doesnt evolve hitting try swimming. But also a lot of early karate is movements and memorization, but it's a lot more physical on body that a bike machine or swimming.