title: Python validate multiple values using if statement
body: <p>Example1 To Check single Value:</p>
  
  <pre><code>def validate(self, data, check, col):
      output = []
      for key, value in data.iteritems():
          try:
              if value[col] == check:
                  output.append("{},{},Passed".format(key,value[col]))
              else:
                  output.append("{},{},Failed".format(key,value[col]))
          except IndexError as e:
              pass
      return output
  
  
  data1 = {key1:['a','b','c','ok'], key2:['a','b','c','down']}
  check = "ok"
  col = 3
  print self.validate(data1, check, col)
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>['key1','ok','Passed', 'key2','down','Failed']
  </code></pre>
  
  <p>Example2 To Check two values:</p>
  
  <pre><code> data1 = {key1:['a','b','c','ok', "True"], key2:['a','b','c','down', "False"]}
  
   def validate(self, data, check1, check2, col1, col2):
      output = []
      for key, value in data.iteritems():
          try:
              if value[col1] == check1 and value[col2] == check2:
                  output.append("{},{},{},Passed".format(key,value[col1], value[col2]))
              else:
                  output.append("{},{},Failed".format(key,value[col1], value[col2]))
          except IndexError as e:
              pass
      return output
  </code></pre>
  
  <p>is there a way that I can achieve the above two examples in one code (Validate multiple values one, two, three, four)</p>