I'm currently doing a python simulation project. For example I have class tank
with the attributes temperature
, volume
and pressure
. But the thing is that volume
is a result of a certain operation between temperature
and pressure
. So how can I insert the volume
as attribute after calculating it using the other two attributes I mentioned. The basic syntax is this:
def __init__(self, temp, pressure, volume)
and for example, to calculate volume
we have volume=temp*pressure
( It's obviously not the right formula just for the sake of simplicity)
Thank you for your help
I tried to create a method for volume
under class tank
, but I dont know if thats the right approach or I should try something else.