human
I am working on the file "FiveThirtyEightRiddler/2017-04-14/2017-04-26-empty_court_seats.ipynb".
The first task is:
We'll also make a class to represent each justice.  When a new Justice is created for a party, they'll be given a randomly generated term of somewhere between 0 and 40 years.
Can you write Python code for it?

=====
Give me a the Python code you requested?
assistant
#Here is the Python code you requested.

class Justice:
    
    def __init__(self, party):
        self.party = party
        self.term = random.randint(0,40)
        
        
    def __str__(self):
        return self.__repr__()
    
    def __repr__(self):
        return "{party}-{term}".format(party=self.party.name,term=self.term)