Run a python program that will receive a chemical compound formula as an input and will give its molar mass
Run a python program that will receive a chemical compound formula as an input and will give its molar mass as an output. The mass of the atoms must be imported from a mass.csv file.
Inputs:
a. Chemical Formula
b. Elements in the compound
c. Number of atoms per element (must be in separated lines depending on the number of elements present)
Output:
a. Molar Mass
Additional Information:
a. If the element entered in “b.” is not in the chemical formula, the output must be: “Incorrect Formula.”
b. If the number of atoms per element is not the same as what was entered in the chemical formula, the output must be: “Incorrect number of atoms.”
Please create a program like this. If not familiar with chemistry, please create a similar program.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps