title: Print all variables and their values
body: <p>This question has been asked quite a bit, and I've tried each solution I come across, but haven't had any success. I'm trying to print out every variable and its value using the following two lines.</p>
  
  <pre><code>for name, value in globals():
      print(name, value)
  </code></pre>
  
  <p>This gives an error: <code>Too many values to unpack
  </code>When I run: </p>
  
  <pre><code>for name in globals():
      print(name)
  </code></pre>
  
  <p>I only get the names of the variables. Any help would be appreciated. </p>