title: check if item is in dictionary values
body: <p>I am trying to code a game for my class programming, and I have to work with a dictionary that looks like this:</p>
  
  <pre><code>board={
      'map': [{'x': 39,
          'y': 41}],
      'hubs': [{'x': 21,
              'y': 3,
              'structure_points': 1000,
              'capacity': 1500,
              'regen_rate': 25},
          {
              'x': 21,
              'y': 38,
              'structure_points': 1000,
              'capacity': 1500,
              'regen_rate': 25}],
      'peaks': [{'x': 10,
              'y': 10,
              'intensity': 200},
          {
              'x': 11,
              'y': 10,
              'intensity': 300},
          {
              'x': 12,
              'y': 10,
              'intensity': 400},
          {
              'x': 10,
              'y': 11,
              'intensity': 200},
          {
              'x': 10,
              'y': 12,
              'intensity': 500}],
      'cruisers': [{
          'alpha': {
              'health_points': 100,
              'available_energy': 400,
              'strike_cost': 10,
              'cruiser_deplacement': 10,
              'shooting_range': 1},
          'beta': {
              'health_points': 100,
              'available_energy': 400,
              'strike_cost': 10,
              'cruiser_deplacement': 10,
              'shooting_range': 1
          }}]}
  </code></pre>
  
  <p>Basically, that dictionary creates a checkerboard and places different units on it (peaks, hubs and cruisers). I would like to create a function that checks if there is already an unit on a certain spot. I already have something like this:</p>
  
  <pre><code>def hub_exists(board, x_dest, y_dest):
      for hub in board.get('hubs', []):
          if hub.get('x') == x_dest and hub.get('y') == y_dest:
              return True
          else:
              return False
  </code></pre>
  
  <p>so this function tells me if a hub is already placed there, but how can make my function understand which  one it is so I can modify the values inside that hub's dictionary? thanks for the help!</p>