You will write four small functions that you can use again for every gas law question. One changes a Celsius temperature to kelvin. One finds the pressure of a gas. One finds the new volume when the pressure and the temperature change. One finds the molar mass from a mass and the conditions.
The idea. The temperature in every gas law is in kelvin, . The ideal gas equation is , and we use with pressure in bar and volume in litres. For a fixed amount of gas, . The molar mass is .
Your tasks.
to_kelvin(celsius).ideal_pressure(n, celsius, volume) so that it returns the pressure in bar.new_volume(p1, v1, c1, p2, c2) so that it returns the new volume. The temperatures are in degrees Celsius.molar_mass(mass, pressure, volume, celsius) so that it returns the molar mass in g/mol.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…