Pneumonia is an infection that affects one or both lungs, and can be caused by bacteria, virus or fungus.