title: How do you get value from another class?
body: <p>I am starting to learn about object-oriented programming and I'm having a rough time with it.
  I have some questions about it:</p>
  <pre class="lang-py prettyprint-override"><code>class Record:
      &quot;&quot;&quot;Represent a record.&quot;&quot;&quot;
      def __init__(self, category, name, value):
          self._category = category
          self._name = name
          self._value = value
          # 1. Define the formal parameters so that a Record can be instantiated
          #    by calling Record('meal', 'breakfast', -50).
          # 2. Initialize the attributes from the parameters. The attribute
          #    names should start with an underscore (e.g. self._amount)
      @property
      def amount (self):
          return self._value
      # Define getter methods for each attribute with @property decorator.
      # Example usage:
      # &gt;&gt;&gt; record = Record('meal', 'breakfast', -50)
      # &gt;&gt;&gt; record.amount
      # -50
  
  class Records:
      &quot;&quot;&quot;Maintain a list of all the 'Record's and the initial amount of money.&quot;&quot;&quot;
      def __init__(self):
          # 1. Read from 'records.txt' or prompt for initial amount of money.
          # 2. Initialize the attributes (self._records and self._initial_money)
          #    from the file or user input.
          self._records =[]
          self._money = 0
          fh = open(file='records.txt', mode='r')
              if ',' not in i:
                  self._money = int(i.strip())
              else:
                  raw_line = i.strip()
                  category, activity, value = raw_line.split(',')
                  x = Record(category, activity, value)
                  self._records.append(x)
              print(&quot;Welcome back!&quot;)
              fh.close()
      @property
      def view(self):
          for i in self._records:
              print(Record._category)
          #1. Print all the records and report the balance.
  
  x = Records()
  Records.view()
  </code></pre>
  <p>I wanted to print out value from my newly acquired list but I don't know how to pass my data from class <code>Records</code> to class <code>Record</code> for processing. How should I approach this?</p>