I'm not sure if this is exactly what you're looking for, but you could have a method inside the Atom class that prints the mass of the atom plus a unit string.
class Atom: def __init__(self, protons, electrons, neutrons): ElemCharge = 1.6021765*(10**-19) UMAS = 1.66054*(10**-27) self.protons = protons self.electrons = electrons self.neutrons = neutrons self.charge = ElemCharge*(self.protons - self.electrons) self.mass = (self.protons + self.neutrons)*UMAS def print_mass_str(self): print('{} {}'.format(self.mass, 'kg'))
Then this:
Argon = Atom(18,18,22)print(Argon.mass)Argon.print_mass_str()
would print:
6.64216e-266.64216e-26 kg