def Ztoelname(Z):
    """
  Returns element name of element with nuclear charge Z.

  Parameters
  ----------

  Z :  int
    nuclear charge of element (e.g. 6 for carbon)

  Returns
  -------
  str
    element name (e.g. "Carbon" for carbon)
  """
    elname = ('Hydrogen', 'Helium', 'Lithium', 'Beryllium', 'Boron',
        'Carbon', 'Nitrogen', 'Oxygen', 'Fluorine', 'Neon', 'Sodium',
        'Magnesium', 'Aluminum', 'Silicon', 'Phosphorus', 'Sulfur',
        'Chlorine', 'Argon', 'Potassium', 'Calcium', 'Scandium', 'Titanium',
        'Vanadium', 'Chromium', 'Manganese', 'Iron', 'Cobalt', 'Nickel',
        'Copper', 'Zinc', 'Gallium', 'Germanium', 'Arsenic', 'Selenium',
        'Bromine', 'Krypton', 'Rubidium', 'Strontium', 'Yttrium',
        'Zirconium', 'Niobium', 'Molybdenum', 'Technetium', 'Ruthenium',
        'Rhodium', 'Palladium', 'Silver', 'Cadmium', 'Indium', 'Tin',
        'Antimony', 'Tellurium', 'Iodine', 'Xenon', 'Cesium', 'Barium',
        'Lanthanum', 'Cerium', 'Praseodymium', 'Neodymium', 'Promethium',
        'Samarium', 'Europium', 'Gadolinium', 'Terbium', 'Dysprosium',
        'Holmium', 'Erbium', 'Thulium', 'Ytterbium', 'Lutetium', 'Hafnium',
        'Tantalum', 'Tungsten', 'Rhenium', 'Osmium', 'Iridium', 'Platinum',
        'Gold', 'Mercury', 'Thallium', 'Lead', 'Bismuth', 'Polonium',
        'Astatine', 'Radon', 'Francium', 'Radium', 'Actinium', 'Thorium',
        'Protactinium', 'Uranium')
    if Z < 1:
        print('Z must be between 1 and 92. You have given Z= ' + repr(Z))
        ret = -1
    elif Z > 92:
        print('Z must be between 1 and 92. You have given Z= ' + repr(Z))
        ret = -1
    else:
        ret = elname[Z - 1]
    return ret
