Over the years, various studies have been dedicated to the mathematical modeling of gas transport and exchange in the lungs. Indeed, the access to the distal region of the lungs with direct measurements is limited and, therefore, models are valuable tools to interpret clinical data and to give more insights into the phenomena taking place in the deepest part of the lungs. In this work, a new computational model of the transport and exchange of a gas species in the human lungs is proposed. It includes (i) a method to generate a lung geometry characterized by an asymmetric branching pattern, based on the values of several parameters that have to be given by the model user, and a method to possibly alter this geometry to mimic lung diseases, (ii) the calculation of the gas flow distribution in this geometry during inspiration or expiration (taking into account the increased resistance to the flow in airways where the flow is non-established), (iii) the evaluation of the exchange fluxes of the gaseous species of interest between the tissues composing the lungs and the lumen, and (iv) the computation of the concentration profile of the exchanged species in the lumen of the tracheobronchial tree. Even if the model is developed in a general framework, a particular attention is given to nitric oxide, as it is not only a gas species of clinical interest, but also a gas species that is both produced in the walls of the airways and consumed within the alveolar region of the lungs. First, the model is presented. Then, several features of the model, applied to lung geometry, gas flow and NO exchange and transport, are discussed, compared to existing works and notably used to give new insights into experimental data available in the literature, regarding diseases, such as asthma, cystic fibrosis, and chronic obstructive pulmonary disease.