difficult practice problem for 61a
#Printing practice, guess what statements print.
class Bernie:
def Bernie():
return Bernie()
def __repr__(self):
return "Sanders"
def elect(self):
self.president = True
class Hillary:
Hillary = Bernie()
Bernie = Bernie
def __init__(self):
self.Hillary = Hillary
def elect(self):
self.president = Obama
return Bernie.Bernie().Bernie()
class Obama(Bernie, Hillary):
campaign = lambda: Hillary.Bernie.Bernie()
#Determine what the following statements print.
print(Obama.campaign())
hillary = Hillary.Hillary
hillary.elect()
print(hillary.president)
hillary = Hillary()
print(Hillary.Hillary.president)