Why is the atomic mass of a element not a whole number like its atomic number and mass number?

An element's atomic mass is not an integer (a whole number) because it is the average mass of all of the element's isotopes (elements that have different amounts of neutrons effecting the mass number of an element). For example, oxygen has 16.01 as its atomic mass. Oxygen has an isotope with 8 neutrons but also has a less rarer isotope with 9 neutrons giving mass numbers of 16 and 17. The atomic mass is slightly pulled over closerto 17, but since 16 in the mass number is more common, the atomic mass is much closer to 16. That there creates the average in the atomic mass.