A gene is an interval (or collection of intervals) of DNA whose nucleotides are transcribed into mRNA and eventually expressed in the cell's function by being translated into protein. Because the creation of proteins determines the organism's function, genes are also viewed as units of heredity; alleles are encoded by (often slight) variations in genes.
Not every nucleotide from a gene must be eventually translated into protein; after a pre-mRNA molecule is formed from transcription, its genes are interspersed with introns and exons. The introns are then excised during RNA splicing to form a final mRNA molecule. As a result, exons are genetically more important than introns, and the exons belonging to a gene form that gene's coding region.
Genes form only about a quarter of the human genome, and exons make up only about 1% of the total. The rest of the genome serves a variety of purposes.