title: returning 1 instead of true in python
body: <p>I am trying to return one instead of true in python.</p>
  
  <p>The code i am working on is:</p>
  
  <pre><code>delimiters = ( '()', '[]', '{}', "''", '""' )
  esc = '\\'
  
  def is_balanced(s, delimiters=delimiters, esc=esc):
      stack = []
      opening = tuple(str[0] for str in delimiters)
      closing = tuple(str[1] for str in delimiters)
      for i, c in enumerate(s):
          if len(stack) and stack[-1] == -1:
              stack.pop()
          elif c in esc:
              stack.append(-1)
          elif c in opening and (not len(stack) or opening[stack[-1]] != closing[stack[-1]]):
              stack.append(opening.index(c))
          elif c in closing:
              if len(stack) == 0 or closing.index(c) != stack[-1]:
                  return False
              stack.pop()
  
      return len(stack) == 0
  
  num_cases = raw_input()
  num_cases = int(num_cases)
  for num in range(num_cases):
      s = raw_input()
      print is_balanced(s)
  </code></pre>
  
  <p>It basically checks whether the string typed is balanced or not. If balanced, should return 1 and if not 0.</p>
  
  <p>I tried this:</p>
  
  <pre><code>1
  Test string
  True
  </code></pre>
  
  <p>It returns true. I would like it to return 1. How do i do it?</p>