title: How to assemble a list of arguments for a function call
body: <p>I have a function like this:</p>
  
  <pre><code>def test(*args):
      if 'test1' in args:
          print('Test1')
  
      if 'test2' in args:
          print('Test2')
  
      if 'test3' in args:
          print('Test3')
  </code></pre>
  
  <p>And now, my question is: I have some variables (like <code>a, b, c</code>), I want to check the variables which is active(or some things) then call my function. </p>
  
  <p>For example: if <code>a</code> is <code>True</code>, then call <code>test('test1')</code>. But if <code>b</code> and <code>c</code> is <code>True</code>, call <code>test('test2', 'test3')</code>. If <code>a</code> and <code>c</code> is <code>True</code>. call <code>test('test1', 'test3')</code>.</p>
  
  <p>But I don't know how can I do that, I can only do something like this:</p>
  
  <pre><code>if a:
      test('test1')
      if b:
          test('test1', 'test2')
          if c:
              test('test1', 'test2', 'test3')
  
  if b:
      test('test2')
  
  and some more code like these.
  </code></pre>
  
  <p>I think there is a easy way to do that.</p>