![]() ![]() Lines 32 to 58 turn this list of lists into a dictionary so that the rest of the program can easily summon the information by an element’s name or atomic number.ġ. csv file and into a list of lists of strings, as lines 15 to 18 do. Python’s csv module makes it easy to import data from a. For example, the first three lines in periodictable.csv look like this: 1,H,Hydrogen,"Greek elements hydro- and -gen, meaning 'water-forming -snip-Ģ,He,Helium,"Greek hḗlios, 'sun'",18,1,4.002602(2),0.0001785 -snip-ģ,Li,Lithium,"Greek líthos, 'stone'",1,2,6.94, -snip. ![]() csv file is a row, and commas separate the columns. csv, or comma-separated values, file is a text file that represents a primitive spreadsheet. Origin of name: Greek molýbdaina, 'piece of lead', from mólybdos, 'lead'Ī. When you run periodictable.py, the output will look like this: Periodic Table of Elementsġ 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18Ĥ K Ca Sc Ti V Cr Mn Fe Co Ni Cu Zn Ga Ge As Se Br Krĥ Rb Sr Y Zr Nb Mo Tc Ru Rh Pd Ag Cd In Sn Sb Te I XeĦ Cs Ba La Hf Ta W Re Os Ir Pt Au Hg Tl Pb Bi Po At Rnħ Fr Ra Ac Rf Db Sg Bh Hs Mt Ds Rg Cn Nh Fl Mc Lv Ts OgĬe Pr Nd Pm Sm Eu Gd Tb Dy Ho Er Tm Yb LuĮnter a symbol or atomic number to examine, or QUIT to quit. I compiled this information from Wikipedia and stored it in a file called periodictable.csv that you can download from. This program presents this table and lets the player access additional information about each element, such as its atomic number, symbol, melting point, and so on. The periodic table of the elements organizes all known chemical elements into a single table.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |