Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use Python 3.6 Part The molar mass of an element is the weight in grams for each mole (a mole 6.02214179x1023 atoms of that element).
Use Python 3.6
Part The molar mass of an element is the weight in grams for each mole (a mole 6.02214179x1023 atoms of that element). For example, the molar mass of carbon (c) is 12.0107g per mole, and the molar mass of oxygen (o) is 15.9994g per mole. The molar mass of a molecule is the sum of the molar masses of its component elements For example, the mass of one mole of carbon monoxide (co) is 12.0107g + 15.9994g = 28.0101g. You will find the following lists necessary: elements - A list of strings containing element symbols o For the purposes of this assignment, we'll only use elements that have . single-letter symbols molarMasses A list of molar masses for each element in elements elements ['H 'B', "c', 'N', '0', 'F', 'P', 'S', 'K', .1.] molarHasses [1.00794, 10.811, 12.0107, 14.0067, 15.9994, 18.998403, 30.973762, 32.065, 39.0983, 126.90447] Write two functions: 1. elementMolarMass o Arguments: - elementSymbol - The single-letter string containing the elemental symbol of the element . The function will return the molar mass of the elemental - Search through elements until it finds one matching elementSymbol o Description: o Basic strategy: Return the molar mass in molarMass at the same index 2. chemicalMass o Arguments: chemicalFormula - A string containing the elemental symbols of the component elements of the chemical numMoles A number that is the amount (in moles) of the chemical " o Description: . The function will return the mass (in g) of numMoles of the chemical represented by chemicalFormula o Basic strategy: . mass (sum of molar masses of component elements) * numMoles Sample Output for Part 3: >>> chemicalMassCO, 12.5) 350.12625 >>> chemicalMass ('HNCO, 3.2) 137.679168Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started