title: How to make example class object using outside function and acces it from outside. Python3.6
body: <p>I have a problem or I just do not understand something at all.
  I would like to make couple examples objects using outside function.
  And then I would like to access them from outside.
  In following code:</p>
  
  <pre><code>class User():
      def __init__(self,id,name,email,password):
          self.id = id 
          self.name = name
          self.email = email
          self.password = password
          print('User created.')
  
  class Category():
      def __init__(self,id,category):
          self.id = id
          self.category = category
          print('Category created.')
  
  class Expenditure():
      def __init__(self,id,category,price,date):
          self.id = id
          self.category = category
          self.price = price
          self.date = date
          print('Expenditure created.')
  
  def example_data():
      """Create example data for the test database."""
      user1 = User("1", 'Daniel', 'dany@gmail.com', 'pass')
      user2 = User(id="1", name='Daniel', email='dany@gmail.com', password='pass')
      cat1 = Category(id="1", category="Food")
      cat2 = Category(id="2", category="Flat")
      expense1 =  Expenditure(id="1", category=cat1.category, price=120, date="2017-12-01")
      expense2 =  Expenditure(id="2", category=cat2.category, price=230, date="2018-11-08")
  
  example_data()
  print(user1.name)
  </code></pre>
  
  <p>After this code I have NameError:</p>
  
  <pre><code>print(user1.name)
  NameError: name 'user1' is not defined
  </code></pre>
  
  <p>Can I make this example working somehow?</p>