class H:
def _init_(self,atom_weight,serial_number,name):
self.atom_weight = 1
self.serial_number = 1
self.name = 'Водород'
def weight(self):
print("Малярная масса равна " + self.atom_weight)
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
H.weight(0)
File "C:\fake\path\to\code.py", line 7, in weight
print("Малярная масса равна " + self.atom_weight)
AttributeError: 'int' object has no attribute 'atom_weight'