Working out

Can you still work out while pregnant? Someone told me you can’t let your heart rate go above 140?