title: Change global variables from inside class method
body: <p>When I try to execute the code below, the first_list gets modified while no changes occur to the second one. Is there a way to replace an outside list with a brand new list, or calling list methods is the only thing I'm allowed to do from inside class methods? I tried adding global keyword before the assignment operation, but it produces a syntax error.</p>
  
  <pre><code>first_list = []
  second_list = []
  
  
  class MyClass:
  
      def change_values(self):
          first_list.append('cat')
          second_list = ['cat']
  
   test = MyClass()
   test.change_values()
   print(first_list)
   print(second_list)
  </code></pre>