Python how to find an object by its attributes?
<p>Is there a way to get an object by matching it up with its attributes? 
For example:</p>

<pre><code>class band:
    def __init__(self, name, number):
    self.name = name
    self.number = number


rivers = band("rivers", 1)
patrick = band("pat" , 2)
brian = band("brian" , 3)
scott = band("scott", 4)
</code></pre>

<p>In this code, is there a way for me to use a number(lets say 1), to find the object rivers within the band class and get its name attribute?</p>

<p>Thank you for taking your time to read this and have a nice day.</p>