00:01
In this video, we're going to be learning how to calculate gas volume.
00:10
So to get started, we're going to create a function in python.
00:18
So with this in mind, we want to have these four different parameters, which these parameters are how we pass information in programming.
00:34
Okay, so let's call r.
00:44
Let's call r function compute.
00:51
And the parameters are passing is a pressure, volume, and the number of moles, and r.
01:11
So we have t, and it's going to equal this number, which is our constant, 8 .3 ,144, 6.
01:24
And for our v, we're simply going to apply the formula, which is b equals n times r times t divided by p.
01:38
So we're going to do that now.
01:39
So n times r times and all divided by p.
01:49
And if you want to format the v to only a certain amount of variables, i'm sorry, certain amount of, uh, places after the decimal.
02:03
You can do three places, format, and then we can return the rounded volume.
02:19
And we can come out of this and then you can create variables.
02:27
And then we have our p and it's going to equal float so that we have a decimal value enter the pressure...