title: alternative of enumerate() in python
body: <p>I want to access the index without using enumerate in this code</p>
  <pre><code>def check(text):
      stack=[]
      index=[]
      for i, ch in enumerate(text):
          if ch in ['{','(']:
              stack.append(ch)
              index.append(i)
  </code></pre>
  <p>here is my approch</p>
  <pre><code>def check(text):
      stack=[]
      index=0
      x=range(len(text))
  
      for i in x:
          if i in ['{','(']:
              stack.append(i)
              index+=1
  </code></pre>
  <p>is it correct?</p>