The measurement that is affected by gravity is B) Weight.
Weight is defined as the force exerted by gravity on an object, and it depends on both the mass of the object and the acceleration due to gravity. In contrast, mass (C) is a measure of the amount of matter in an object and remains constant regardless of location, while inertia (A) refers to an object's resistance to changes in its state of motion. Density (D) is the mass of an object per unit volume and is also not directly affected by gravity.