rockverse.dect.PeriodicTable.add_element#
- PeriodicTable.add_element(name, Z, M)[source]#
Adds a new element to the periodic table.
- Parameters:
name (str) – The name of the element.
Z (int or float) – The atomic number of the element.
M (int or float) – The atomic mass of the element.
Example
Use this method to add new elements to the table:
>>> dectgroup.periodic_table['Hi/M'] # This will raise KeyError ... KeyError: 'Element Hi not found in database.' >>> dectgroup.periodic_table.add_element(name='Hi', Z=123, M=244.345) >>> dectgroup.periodic_table['Hi/Z'] 123 >>> dectgroup.periodic_table['Hi/M'] 244.345