Genes contain the code for proteins and are segments of DNA. Humans have 46 chromosomes total that are arranged in 23 homologous pairs, with one set inherited from each parent. Chromosomes exist in cells in either a diploid form with two of each chromosome or a haploid form with one. The first 22 chromosome pairs are autosomes, while the 23rd pair determines sex as either XX or XY.