How is oxygen and carbon dioxide exchange mediated by hemoglobin?
Under conditions of high CO2 (in tissues such as muscle) and hence high acidity hemoglobin binds preferentially CO2, thereby mediating CO2 removal. Under conditions of low CO2 (high pH) and high O2 (conditions met in the lungs), it preferably binds O2, thereby releasing CO2. Hence, the specific characteristics of hemoglobin allow for CO2 uptake in the body, and O2 uptake and CO2 release in the lungs. Info from wikipedia on hemoglobin