title: Python use try/except in for loop
body: <p>I'm new to python exception. I want to try catch/except in a for loop, how can I implement the code. Thank you.</p>
  
  <pre><code>a=5
  b=[[1,3,3,4],[1,2,3,4]]
  entry=[]
  error=[]
  for nums in b:
      try:
          for num in nums:
          if a-num==3:
              entry.append("yes")
  except:
      error.append('no')
  </code></pre>
  
  <p>I only have value in entry and error is still empty. How can I fix my code. Thank you.</p>