Question: Do the following: Using VS Code, create a new file and save it as chemistry.py In the chemistry.py file, write a function named make _

Do the following:
Using VS Code, create a new file and save it as chemistry.py
In the chemistry.py file, write a function named make_periodic_table that takes no parameters and creates and returns a compound list. The compound list must contain all the data in the table of elements shown in the Table of Elements section above. The data within the compound list must be organized like this:
periodic_table_list =[
# [symbol, name, atomic_mass]
["Ac", "Actinium", 227],
["Ag", "Silver", 107.8682],
["Al", "Aluminum", 26.9815386],
]
We strongly recommend that you do not type the data in the table of elements but instead that you copy and paste the data from this assignment into your program. If you dont know how to use copy and paste to help you quickly write the make_periodic_table function, ask a fellow student, a tutor, a teaching assistant, or your teacher for help.
After you copy and paste the periodic table data into your program, you must add square brackets ([ and ]) and commas (,) so that the data is organized in a compound list. If youre using VS Code as your text editor, you can use multi-line editing to quickly add all the necessary square brackets and commas.
In the chemistry.py file, write the main function that takes no parameters and returns nothing. The main function should do the following:
Get a chemical formula for a molecule from the user.
Get the mass of a chemical sample in grams from the user.
Call the make_periodic_table function and store the returned list in a variable.
Print the name and atomic mass for each chemical element on a separate line. Do not print the chemical element symbols.
At the bottom of your chemistry.py file, add a call to the main function. Be certain to protect the call to main with an if statement as taught in the preparation content for week 03.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!