title: correct way to define class variables in Python
body: <p>I noticed that in Python, people initialize their class attributes in two different ways.</p>
  <p>The first way is like this:</p>
  <pre><code>class MyClass:
    __element1 = 123
    __element2 = &quot;this is Africa&quot;
  
    def __init__(self):
      #pass or something else
  </code></pre>
  <p>The other style looks like:</p>
  <pre><code>class MyClass:
    def __init__(self):
      self.__element1 = 123
      self.__element2 = &quot;this is Africa&quot;
  </code></pre>
  <p>Which is the correct way to initialize class attributes?</p>