classes define all the constants used in the formula self tself gand so on where the prefix self means that these variables become bound to the object created such bound variables are called attributes finallywe define the method valuewhich evaluates the formula using the predefined and objectbound parameters self tself gself rself mand self after we have defined the classevery time we write line such as barometric( = we create new variable (instanceb of type barometric the line looks like regular function callbutsince barometric is the definition of class and not functionbarometric( = is instead call to the classconstructor the constructor creates and returns an instance of the class with the specified values of the parametersand we assign this instance to the variable all the __init__ functions we encounter in this book will follow exactly the same recipe their purpose is to define number of attributes for the classand they will typically contain one or more lines of the form self awhere is either an argument passed to the constructor or value defined inside it as always in programmingthere are different ways to achieve the same thingand we could have chosen different implementation of the class above since the only argument to the constructor is tthe other attributes never change and they could have been local variables inside the value methodclass barometric def __init__(selft)self # def value(selfh) return exp(- * * /( *self )notice thatinside the value methodwe only use the self prefix for tsince this is the only variable that is class attribute in this version of the class the other variables are regular local variables defined inside the method this class does exactly the same thing as the one defined aboveand one could argue that this implementation is bettersince it is shorter and simpler than the one above howeverdefining all the physical constants in one place (in the constructorcan make the code easier to readand the class easier to extend with more methods as third possible implementationwe could move some of the calculations from the value method to the constructorclass barometric def __init__(selft) # /( *sr # /( *molm #kg/mol self * /( *gself #kpa