title: Python. Check if index exists in a list of possible dictionaries
body: <p>I have this:</p>
  
  <pre><code>list_name = [0, 1, 2, 3]
  list_name[0] = {}
  list_name[0]['test'] = 'any value'
  </code></pre>
  
  <p>I want to know if a key of the list exists or not. Usually I use:</p>
  
  <pre><code>if 3 not in list_name:
      print("this doesn't exist")
  else:
      print("exists")
  </code></pre>
  
  <p>And testing this for example for number 3 is working. It says "exists". If I check for number 999 is working, it says "this doesn't exist".</p>
  
  <p>The problem is that it is not working for 0. As you can see, 0 value in the list has a dictionary. And I need to check if 0 exists or not in the list (doesn't matter if it has a dictionary or not). How to achieve this? Using python3, thank you.</p>