0

I have a function that calculates the volume of a cone.

def volume(zmin,zmax):
    #calculate volume using some calculations

However for the zmin, zmax arguments, I would like to give a list of parameters. i.e. I want to call the volume function several times using a list of parameters.

I actually want to subtract two volume parts of the same cone so that I get the volume in between.

An example of what I want is:

volume(0.0,0.4) - volume(0.0,0.1) 
volume(0.0,0.7) - volume(0.0,0.4) 

and so on.

How do I achieve this ?

If I store them in lists like:

list = [(0.0,0.4),(0.0,0.1),(0.0,0.7),(0.0,0.4),(0.0,1.0),(0.0,0.7)]

can I use zip somehow to call this list as the function parameter?

Srivatsan
  • 9,225
  • 13
  • 58
  • 83
  • Can you provide something concrete in terms of sample input, and expected output? – hjpotter92 Sep 28 '15 at 09:46
  • @hjpotter92: I just need to call the volume function as mentioned in the example above. Since I need to call it several times using several different input parameters, I would like to know how I can automise it by just one call – Srivatsan Sep 28 '15 at 09:46

0 Answers0