<p>Is there a built-in method in Python to get an array of all a class' instance variables? For example, if I have this code:</p>

<pre><code>class hi:
  def __init__(self):
    self.ii = "foo"
    self.kk = "bar"
</code></pre>

<p>Is there a way for me to do this:</p>

<pre><code>&gt;&gt;&gt; mystery_method(hi)
["ii", "kk"]
</code></pre>

<p>Edit: I originally had asked for class variables erroneously.</p>

Every object has a
```
__dict__
```
variable containing all the variables and its values in it.
Try this
```
```
>>> hi_obj = hi()
>>> hi_obj.__dict__.keys()
```
```
Output
```
```
dict_keys(['ii', 'kk'])
```
```