{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from rdkit import Chem" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "elements = \"\"\"H,\n", "He,\n", "Li,\n", "Be,\n", "B,\n", "C,\n", "N,\n", "O,\n", "F,\n", "Ne,\n", "Na,\n", "Mg,\n", "Al,\n", "Si,\n", "P,\n", "S,\n", "Cl,\n", "Ar,\n", "K,\n", "Ca,\n", "Sc,\n", "Ti,\n", "V,\n", "Cr,\n", "Mn,\n", "Fe,\n", "Co,\n", "Ni,\n", "Cu,\n", "Zn,\n", "Ga,\n", "Ge,\n", "As,\n", "Se,\n", "Br,\n", "Kr,\n", "Rb,\n", "Sr,\n", "Y,\n", "Zr,\n", "Nb,\n", "Mo,\n", "Tc,\n", "Ru,\n", "Rh,\n", "Pd,\n", "Ag,\n", "Cd,\n", "In,\n", "Sn,\n", "Sb,\n", "Te,\n", "I,\n", "Xe,\n", "Cs,\n", "Ba,\n", "La,\n", "Ce,\n", "Pr,\n", "Nd,\n", "Pm,\n", "Sm,\n", "Eu,\n", "Gd,\n", "Tb,\n", "Dy,\n", "Ho,\n", "Er,\n", "Tm,\n", "Yb,\n", "Lu,\n", "Hf,\n", "Ta,\n", "W,\n", "Re,\n", "Os,\n", "Ir,\n", "Pt,\n", "Au,\n", "Hg,\n", "Tl,\n", "Pb,\n", "Bi,\n", "Po,\n", "At,\n", "Rn,\n", "Fr,\n", "Ra,\n", "Ac,\n", "Th,\n", "Pa,\n", "U,\n", "Np,\n", "Pu,\n", "Am,\n", "Cm,\n", "Bk,\n", "Cf,\n", "Es,\n", "Fm,\n", "Md,\n", "No,\n", "Lr,\n", "Rf,\n", "Db,\n", "Sg,\n", "Bh,\n", "Hs,\n", "Mt,\n", "Ds,\n", "Rg,\n", "Cn,\n", "Nh,\n", "Fl,\n", "Mc,\n", "Lv,\n", "Ts,\n", "Og\"\"\".split(',\\n')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# impl TryFrom\\ for Element" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1 => Ok(Element::H),\n", "2 => Ok(Element::He),\n", "3 => Ok(Element::Li),\n", "4 => Ok(Element::Be),\n", "5 => Ok(Element::B),\n", "6 => Ok(Element::C),\n", "7 => Ok(Element::N),\n", "8 => Ok(Element::O),\n", "9 => Ok(Element::F),\n", "10 => Ok(Element::Ne),\n", "11 => Ok(Element::Na),\n", "12 => Ok(Element::Mg),\n", "13 => Ok(Element::Al),\n", "14 => Ok(Element::Si),\n", "15 => Ok(Element::P),\n", "16 => Ok(Element::S),\n", "17 => Ok(Element::Cl),\n", "18 => Ok(Element::Ar),\n", "19 => Ok(Element::K),\n", "20 => Ok(Element::Ca),\n", "21 => Ok(Element::Sc),\n", "22 => Ok(Element::Ti),\n", "23 => Ok(Element::V),\n", "24 => Ok(Element::Cr),\n", "25 => Ok(Element::Mn),\n", "26 => Ok(Element::Fe),\n", "27 => Ok(Element::Co),\n", "28 => Ok(Element::Ni),\n", "29 => Ok(Element::Cu),\n", "30 => Ok(Element::Zn),\n", "31 => Ok(Element::Ga),\n", "32 => Ok(Element::Ge),\n", "33 => Ok(Element::As),\n", "34 => Ok(Element::Se),\n", "35 => Ok(Element::Br),\n", "36 => Ok(Element::Kr),\n", "37 => Ok(Element::Rb),\n", "38 => Ok(Element::Sr),\n", "39 => Ok(Element::Y),\n", "40 => Ok(Element::Zr),\n", "41 => Ok(Element::Nb),\n", "42 => Ok(Element::Mo),\n", "43 => Ok(Element::Tc),\n", "44 => Ok(Element::Ru),\n", "45 => Ok(Element::Rh),\n", "46 => Ok(Element::Pd),\n", "47 => Ok(Element::Ag),\n", "48 => Ok(Element::Cd),\n", "49 => Ok(Element::In),\n", "50 => Ok(Element::Sn),\n", "51 => Ok(Element::Sb),\n", "52 => Ok(Element::Te),\n", "53 => Ok(Element::I),\n", "54 => Ok(Element::Xe),\n", "55 => Ok(Element::Cs),\n", "56 => Ok(Element::Ba),\n", "57 => Ok(Element::La),\n", "58 => Ok(Element::Ce),\n", "59 => Ok(Element::Pr),\n", "60 => Ok(Element::Nd),\n", "61 => Ok(Element::Pm),\n", "62 => Ok(Element::Sm),\n", "63 => Ok(Element::Eu),\n", "64 => Ok(Element::Gd),\n", "65 => Ok(Element::Tb),\n", "66 => Ok(Element::Dy),\n", "67 => Ok(Element::Ho),\n", "68 => Ok(Element::Er),\n", "69 => Ok(Element::Tm),\n", "70 => Ok(Element::Yb),\n", "71 => Ok(Element::Lu),\n", "72 => Ok(Element::Hf),\n", "73 => Ok(Element::Ta),\n", "74 => Ok(Element::W),\n", "75 => Ok(Element::Re),\n", "76 => Ok(Element::Os),\n", "77 => Ok(Element::Ir),\n", "78 => Ok(Element::Pt),\n", "79 => Ok(Element::Au),\n", "80 => Ok(Element::Hg),\n", "81 => Ok(Element::Tl),\n", "82 => Ok(Element::Pb),\n", "83 => Ok(Element::Bi),\n", "84 => Ok(Element::Po),\n", "85 => Ok(Element::At),\n", "86 => Ok(Element::Rn),\n", "87 => Ok(Element::Fr),\n", "88 => Ok(Element::Ra),\n", "89 => Ok(Element::Ac),\n", "90 => Ok(Element::Th),\n", "91 => Ok(Element::Pa),\n", "92 => Ok(Element::U),\n", "93 => Ok(Element::Np),\n", "94 => Ok(Element::Pu),\n", "95 => Ok(Element::Am),\n", "96 => Ok(Element::Cm),\n", "97 => Ok(Element::Bk),\n", "98 => Ok(Element::Cf),\n", "99 => Ok(Element::Es),\n", "100 => Ok(Element::Fm),\n", "101 => Ok(Element::Md),\n", "102 => Ok(Element::No),\n", "103 => Ok(Element::Lr),\n", "104 => Ok(Element::Rf),\n", "105 => Ok(Element::Db),\n", "106 => Ok(Element::Sg),\n", "107 => Ok(Element::Bh),\n", "108 => Ok(Element::Hs),\n", "109 => Ok(Element::Mt),\n", "110 => Ok(Element::Ds),\n", "111 => Ok(Element::Rg),\n", "112 => Ok(Element::Cn),\n", "113 => Ok(Element::Nh),\n", "114 => Ok(Element::Fl),\n", "115 => Ok(Element::Mc),\n", "116 => Ok(Element::Lv),\n", "117 => Ok(Element::Ts),\n", "118 => Ok(Element::Og),\n" ] } ], "source": [ "for atomic_number, element in zip(range(1,120), elements):\n", " print(f\"{atomic_number} => Ok(Element::{element}),\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# impl TryFrom\\ for Element" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\"h\" => Ok(Element::H),\n", "\"he\" => Ok(Element::He),\n", "\"li\" => Ok(Element::Li),\n", "\"be\" => Ok(Element::Be),\n", "\"b\" => Ok(Element::B),\n", "\"c\" => Ok(Element::C),\n", "\"n\" => Ok(Element::N),\n", "\"o\" => Ok(Element::O),\n", "\"f\" => Ok(Element::F),\n", "\"ne\" => Ok(Element::Ne),\n", "\"na\" => Ok(Element::Na),\n", "\"mg\" => Ok(Element::Mg),\n", "\"al\" => Ok(Element::Al),\n", "\"si\" => Ok(Element::Si),\n", "\"p\" => Ok(Element::P),\n", "\"s\" => Ok(Element::S),\n", "\"cl\" => Ok(Element::Cl),\n", "\"ar\" => Ok(Element::Ar),\n", "\"k\" => Ok(Element::K),\n", "\"ca\" => Ok(Element::Ca),\n", "\"sc\" => Ok(Element::Sc),\n", "\"ti\" => Ok(Element::Ti),\n", "\"v\" => Ok(Element::V),\n", "\"cr\" => Ok(Element::Cr),\n", "\"mn\" => Ok(Element::Mn),\n", "\"fe\" => Ok(Element::Fe),\n", "\"co\" => Ok(Element::Co),\n", "\"ni\" => Ok(Element::Ni),\n", "\"cu\" => Ok(Element::Cu),\n", "\"zn\" => Ok(Element::Zn),\n", "\"ga\" => Ok(Element::Ga),\n", "\"ge\" => Ok(Element::Ge),\n", "\"as\" => Ok(Element::As),\n", "\"se\" => Ok(Element::Se),\n", "\"br\" => Ok(Element::Br),\n", "\"kr\" => Ok(Element::Kr),\n", "\"rb\" => Ok(Element::Rb),\n", "\"sr\" => Ok(Element::Sr),\n", "\"y\" => Ok(Element::Y),\n", "\"zr\" => Ok(Element::Zr),\n", "\"nb\" => Ok(Element::Nb),\n", "\"mo\" => Ok(Element::Mo),\n", "\"tc\" => Ok(Element::Tc),\n", "\"ru\" => Ok(Element::Ru),\n", "\"rh\" => Ok(Element::Rh),\n", "\"pd\" => Ok(Element::Pd),\n", "\"ag\" => Ok(Element::Ag),\n", "\"cd\" => Ok(Element::Cd),\n", "\"in\" => Ok(Element::In),\n", "\"sn\" => Ok(Element::Sn),\n", "\"sb\" => Ok(Element::Sb),\n", "\"te\" => Ok(Element::Te),\n", "\"i\" => Ok(Element::I),\n", "\"xe\" => Ok(Element::Xe),\n", "\"cs\" => Ok(Element::Cs),\n", "\"ba\" => Ok(Element::Ba),\n", "\"la\" => Ok(Element::La),\n", "\"ce\" => Ok(Element::Ce),\n", "\"pr\" => Ok(Element::Pr),\n", "\"nd\" => Ok(Element::Nd),\n", "\"pm\" => Ok(Element::Pm),\n", "\"sm\" => Ok(Element::Sm),\n", "\"eu\" => Ok(Element::Eu),\n", "\"gd\" => Ok(Element::Gd),\n", "\"tb\" => Ok(Element::Tb),\n", "\"dy\" => Ok(Element::Dy),\n", "\"ho\" => Ok(Element::Ho),\n", "\"er\" => Ok(Element::Er),\n", "\"tm\" => Ok(Element::Tm),\n", "\"yb\" => Ok(Element::Yb),\n", "\"lu\" => Ok(Element::Lu),\n", "\"hf\" => Ok(Element::Hf),\n", "\"ta\" => Ok(Element::Ta),\n", "\"w\" => Ok(Element::W),\n", "\"re\" => Ok(Element::Re),\n", "\"os\" => Ok(Element::Os),\n", "\"ir\" => Ok(Element::Ir),\n", "\"pt\" => Ok(Element::Pt),\n", "\"au\" => Ok(Element::Au),\n", "\"hg\" => Ok(Element::Hg),\n", "\"tl\" => Ok(Element::Tl),\n", "\"pb\" => Ok(Element::Pb),\n", "\"bi\" => Ok(Element::Bi),\n", "\"po\" => Ok(Element::Po),\n", "\"at\" => Ok(Element::At),\n", "\"rn\" => Ok(Element::Rn),\n", "\"fr\" => Ok(Element::Fr),\n", "\"ra\" => Ok(Element::Ra),\n", "\"ac\" => Ok(Element::Ac),\n", "\"th\" => Ok(Element::Th),\n", "\"pa\" => Ok(Element::Pa),\n", "\"u\" => Ok(Element::U),\n", "\"np\" => Ok(Element::Np),\n", "\"pu\" => Ok(Element::Pu),\n", "\"am\" => Ok(Element::Am),\n", "\"cm\" => Ok(Element::Cm),\n", "\"bk\" => Ok(Element::Bk),\n", "\"cf\" => Ok(Element::Cf),\n", "\"es\" => Ok(Element::Es),\n", "\"fm\" => Ok(Element::Fm),\n", "\"md\" => Ok(Element::Md),\n", "\"no\" => Ok(Element::No),\n", "\"lr\" => Ok(Element::Lr),\n", "\"rf\" => Ok(Element::Rf),\n", "\"db\" => Ok(Element::Db),\n", "\"sg\" => Ok(Element::Sg),\n", "\"bh\" => Ok(Element::Bh),\n", "\"hs\" => Ok(Element::Hs),\n", "\"mt\" => Ok(Element::Mt),\n", "\"ds\" => Ok(Element::Ds),\n", "\"rg\" => Ok(Element::Rg),\n", "\"cn\" => Ok(Element::Cn),\n", "\"nh\" => Ok(Element::Nh),\n", "\"fl\" => Ok(Element::Fl),\n", "\"mc\" => Ok(Element::Mc),\n", "\"lv\" => Ok(Element::Lv),\n", "\"ts\" => Ok(Element::Ts),\n", "\"og\" => Ok(Element::Og),\n" ] } ], "source": [ "for element in elements:\n", " print(f'\"{element.lower()}\" => Ok(Element::{element}),')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# impl Display" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Element::H => write!(f, \"H\"),\n", "Element::He => write!(f, \"He\"),\n", "Element::Li => write!(f, \"Li\"),\n", "Element::Be => write!(f, \"Be\"),\n", "Element::B => write!(f, \"B\"),\n", "Element::C => write!(f, \"C\"),\n", "Element::N => write!(f, \"N\"),\n", "Element::O => write!(f, \"O\"),\n", "Element::F => write!(f, \"F\"),\n", "Element::Ne => write!(f, \"Ne\"),\n", "Element::Na => write!(f, \"Na\"),\n", "Element::Mg => write!(f, \"Mg\"),\n", "Element::Al => write!(f, \"Al\"),\n", "Element::Si => write!(f, \"Si\"),\n", "Element::P => write!(f, \"P\"),\n", "Element::S => write!(f, \"S\"),\n", "Element::Cl => write!(f, \"Cl\"),\n", "Element::Ar => write!(f, \"Ar\"),\n", "Element::K => write!(f, \"K\"),\n", "Element::Ca => write!(f, \"Ca\"),\n", "Element::Sc => write!(f, \"Sc\"),\n", "Element::Ti => write!(f, \"Ti\"),\n", "Element::V => write!(f, \"V\"),\n", "Element::Cr => write!(f, \"Cr\"),\n", "Element::Mn => write!(f, \"Mn\"),\n", "Element::Fe => write!(f, \"Fe\"),\n", "Element::Co => write!(f, \"Co\"),\n", "Element::Ni => write!(f, \"Ni\"),\n", "Element::Cu => write!(f, \"Cu\"),\n", "Element::Zn => write!(f, \"Zn\"),\n", "Element::Ga => write!(f, \"Ga\"),\n", "Element::Ge => write!(f, \"Ge\"),\n", "Element::As => write!(f, \"As\"),\n", "Element::Se => write!(f, \"Se\"),\n", "Element::Br => write!(f, \"Br\"),\n", "Element::Kr => write!(f, \"Kr\"),\n", "Element::Rb => write!(f, \"Rb\"),\n", "Element::Sr => write!(f, \"Sr\"),\n", "Element::Y => write!(f, \"Y\"),\n", "Element::Zr => write!(f, \"Zr\"),\n", "Element::Nb => write!(f, \"Nb\"),\n", "Element::Mo => write!(f, \"Mo\"),\n", "Element::Tc => write!(f, \"Tc\"),\n", "Element::Ru => write!(f, \"Ru\"),\n", "Element::Rh => write!(f, \"Rh\"),\n", "Element::Pd => write!(f, \"Pd\"),\n", "Element::Ag => write!(f, \"Ag\"),\n", "Element::Cd => write!(f, \"Cd\"),\n", "Element::In => write!(f, \"In\"),\n", "Element::Sn => write!(f, \"Sn\"),\n", "Element::Sb => write!(f, \"Sb\"),\n", "Element::Te => write!(f, \"Te\"),\n", "Element::I => write!(f, \"I\"),\n", "Element::Xe => write!(f, \"Xe\"),\n", "Element::Cs => write!(f, \"Cs\"),\n", "Element::Ba => write!(f, \"Ba\"),\n", "Element::La => write!(f, \"La\"),\n", "Element::Ce => write!(f, \"Ce\"),\n", "Element::Pr => write!(f, \"Pr\"),\n", "Element::Nd => write!(f, \"Nd\"),\n", "Element::Pm => write!(f, \"Pm\"),\n", "Element::Sm => write!(f, \"Sm\"),\n", "Element::Eu => write!(f, \"Eu\"),\n", "Element::Gd => write!(f, \"Gd\"),\n", "Element::Tb => write!(f, \"Tb\"),\n", "Element::Dy => write!(f, \"Dy\"),\n", "Element::Ho => write!(f, \"Ho\"),\n", "Element::Er => write!(f, \"Er\"),\n", "Element::Tm => write!(f, \"Tm\"),\n", "Element::Yb => write!(f, \"Yb\"),\n", "Element::Lu => write!(f, \"Lu\"),\n", "Element::Hf => write!(f, \"Hf\"),\n", "Element::Ta => write!(f, \"Ta\"),\n", "Element::W => write!(f, \"W\"),\n", "Element::Re => write!(f, \"Re\"),\n", "Element::Os => write!(f, \"Os\"),\n", "Element::Ir => write!(f, \"Ir\"),\n", "Element::Pt => write!(f, \"Pt\"),\n", "Element::Au => write!(f, \"Au\"),\n", "Element::Hg => write!(f, \"Hg\"),\n", "Element::Tl => write!(f, \"Tl\"),\n", "Element::Pb => write!(f, \"Pb\"),\n", "Element::Bi => write!(f, \"Bi\"),\n", "Element::Po => write!(f, \"Po\"),\n", "Element::At => write!(f, \"At\"),\n", "Element::Rn => write!(f, \"Rn\"),\n", "Element::Fr => write!(f, \"Fr\"),\n", "Element::Ra => write!(f, \"Ra\"),\n", "Element::Ac => write!(f, \"Ac\"),\n", "Element::Th => write!(f, \"Th\"),\n", "Element::Pa => write!(f, \"Pa\"),\n", "Element::U => write!(f, \"U\"),\n", "Element::Np => write!(f, \"Np\"),\n", "Element::Pu => write!(f, \"Pu\"),\n", "Element::Am => write!(f, \"Am\"),\n", "Element::Cm => write!(f, \"Cm\"),\n", "Element::Bk => write!(f, \"Bk\"),\n", "Element::Cf => write!(f, \"Cf\"),\n", "Element::Es => write!(f, \"Es\"),\n", "Element::Fm => write!(f, \"Fm\"),\n", "Element::Md => write!(f, \"Md\"),\n", "Element::No => write!(f, \"No\"),\n", "Element::Lr => write!(f, \"Lr\"),\n", "Element::Rf => write!(f, \"Rf\"),\n", "Element::Db => write!(f, \"Db\"),\n", "Element::Sg => write!(f, \"Sg\"),\n", "Element::Bh => write!(f, \"Bh\"),\n", "Element::Hs => write!(f, \"Hs\"),\n", "Element::Mt => write!(f, \"Mt\"),\n", "Element::Ds => write!(f, \"Ds\"),\n", "Element::Rg => write!(f, \"Rg\"),\n", "Element::Cn => write!(f, \"Cn\"),\n", "Element::Nh => write!(f, \"Nh\"),\n", "Element::Fl => write!(f, \"Fl\"),\n", "Element::Mc => write!(f, \"Mc\"),\n", "Element::Lv => write!(f, \"Lv\"),\n", "Element::Ts => write!(f, \"Ts\"),\n", "Element::Og => write!(f, \"Og\"),\n" ] } ], "source": [ "for element in elements:\n", " print(f'Element::{element} => write!(f, \"{element}\"),')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# impl From\\ for usize" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Element::H => 1,\n", "Element::He => 2,\n", "Element::Li => 3,\n", "Element::Be => 4,\n", "Element::B => 5,\n", "Element::C => 6,\n", "Element::N => 7,\n", "Element::O => 8,\n", "Element::F => 9,\n", "Element::Ne => 10,\n", "Element::Na => 11,\n", "Element::Mg => 12,\n", "Element::Al => 13,\n", "Element::Si => 14,\n", "Element::P => 15,\n", "Element::S => 16,\n", "Element::Cl => 17,\n", "Element::Ar => 18,\n", "Element::K => 19,\n", "Element::Ca => 20,\n", "Element::Sc => 21,\n", "Element::Ti => 22,\n", "Element::V => 23,\n", "Element::Cr => 24,\n", "Element::Mn => 25,\n", "Element::Fe => 26,\n", "Element::Co => 27,\n", "Element::Ni => 28,\n", "Element::Cu => 29,\n", "Element::Zn => 30,\n", "Element::Ga => 31,\n", "Element::Ge => 32,\n", "Element::As => 33,\n", "Element::Se => 34,\n", "Element::Br => 35,\n", "Element::Kr => 36,\n", "Element::Rb => 37,\n", "Element::Sr => 38,\n", "Element::Y => 39,\n", "Element::Zr => 40,\n", "Element::Nb => 41,\n", "Element::Mo => 42,\n", "Element::Tc => 43,\n", "Element::Ru => 44,\n", "Element::Rh => 45,\n", "Element::Pd => 46,\n", "Element::Ag => 47,\n", "Element::Cd => 48,\n", "Element::In => 49,\n", "Element::Sn => 50,\n", "Element::Sb => 51,\n", "Element::Te => 52,\n", "Element::I => 53,\n", "Element::Xe => 54,\n", "Element::Cs => 55,\n", "Element::Ba => 56,\n", "Element::La => 57,\n", "Element::Ce => 58,\n", "Element::Pr => 59,\n", "Element::Nd => 60,\n", "Element::Pm => 61,\n", "Element::Sm => 62,\n", "Element::Eu => 63,\n", "Element::Gd => 64,\n", "Element::Tb => 65,\n", "Element::Dy => 66,\n", "Element::Ho => 67,\n", "Element::Er => 68,\n", "Element::Tm => 69,\n", "Element::Yb => 70,\n", "Element::Lu => 71,\n", "Element::Hf => 72,\n", "Element::Ta => 73,\n", "Element::W => 74,\n", "Element::Re => 75,\n", "Element::Os => 76,\n", "Element::Ir => 77,\n", "Element::Pt => 78,\n", "Element::Au => 79,\n", "Element::Hg => 80,\n", "Element::Tl => 81,\n", "Element::Pb => 82,\n", "Element::Bi => 83,\n", "Element::Po => 84,\n", "Element::At => 85,\n", "Element::Rn => 86,\n", "Element::Fr => 87,\n", "Element::Ra => 88,\n", "Element::Ac => 89,\n", "Element::Th => 90,\n", "Element::Pa => 91,\n", "Element::U => 92,\n", "Element::Np => 93,\n", "Element::Pu => 94,\n", "Element::Am => 95,\n", "Element::Cm => 96,\n", "Element::Bk => 97,\n", "Element::Cf => 98,\n", "Element::Es => 99,\n", "Element::Fm => 100,\n", "Element::Md => 101,\n", "Element::No => 102,\n", "Element::Lr => 103,\n", "Element::Rf => 104,\n", "Element::Db => 105,\n", "Element::Sg => 106,\n", "Element::Bh => 107,\n", "Element::Hs => 108,\n", "Element::Mt => 109,\n", "Element::Ds => 110,\n", "Element::Rg => 111,\n", "Element::Cn => 112,\n", "Element::Nh => 113,\n", "Element::Fl => 114,\n", "Element::Mc => 115,\n", "Element::Lv => 116,\n", "Element::Ts => 117,\n", "Element::Og => 118,\n" ] } ], "source": [ "for atomic_number, element in zip(range(1,120), elements):\n", " print(f\"Element::{element} => {atomic_number},\")" ] } ], "metadata": { "kernelspec": { "display_name": "mol", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.4" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }