title: Accessing attribute from python Class to a dictionary
body: <p>I have a python Class that contains info of the trading market, but I would like access just one attribute from the entire class. any idea on how to do this? thank you.</p>
  
  <p>I have tried this :</p>
  
  <pre><code>class StockDataWebSocket:
      web_socket_symbol_list = []
      web_socket_instance_dict = {}
  
      def __init__(self, symbol):
           self.price = None
           self.last_price = 0
  symbol = 'test'       
  instance = StockDataWebSocket(symbol)
  StockDataWebSocket.web_socket_symbol_list.append(symbol)
  StockDataWebSocket.web_socket_instance_dict[symbol] = instance.last_price
  
  last_price = StockDataWebSocket.web_socket_instance_dict[symbol].last_price
  print (last_price)
  </code></pre>
  
  <p>i would like to get the 0, but i am getting:NameError: name 'last_price' is not defined</p>