# /( *mol#kg/mol #kpa return exp(- * * /( * )we now have function that takes single argumentbut defining as global variable is not very convenient if we want to evaluate (tfor different values of we could also set as local variable inside the function and define different functions barometric ( )barometric ( )etc for different values of tbut this is obviously inconvenient if we want many values of howeverwe shall see that programming with classes and objects offers exactly what we needa convenient solution to create family of similar functions that all have their own value of as mentioned abovethe idea of class is to pack together data and methods (or functionsthat naturally operate on the data we can make class barometric for the formula at handwith the variables rt,' 'gand as dataand method value(tfor evaluating the formula all classes should also have method named __init__ to initialize the variables the following code defines our function class class barometricdef __init__(selft)self self self self self # # /( * # /( *mol#kg/mol #kpa def value(selfh)return self exp(-self *self * /(self *self )having defined this classwe can create instances of the class with specific values of the parameter tand then we can call the method value with as the only argumentb barometric( = value( barometric( = value( create instance (objectcompute function value these code segments introduce number of new concepts worth dissecting firstwe have class definition thatin pythonalways starts with the word classfollowed by the name of the class and colon the following indented block of code defines the contents of the class just as we are used to when we implement functionsthe indentation defines what belongs inside the class definition the first contents of our classand of most classesis method with the special name __init__which is called the constructor of the class this method is automatically called every time we create an instance in the classas in the line barometric( = above inside the methodwe