title: Python method vs function
body: <p>I am seeking for a confirmation if my thinking is correct in terms of Python method vs function:</p>
  
  <p>A method is a part of a class.</p>
  
  <p>A function is defined outside of a class.</p>
  
  <p>so e.g.</p>
  
  <pre><code>class FooBar(object):
      def __init__(self):
          pass
      def foo(self):
          pass
  
  
  def bar():
      pass
  
  
  if __name__ == '__main__':
      fb = FooBar()
  </code></pre>
  
  <p>I understand <code>def foo</code> defines method and <code>def bar</code> defines function. Am I correct?</p>