observer pattern class user(object)def __init__(selfwallet)self wallet wallet self badges [self experience def add_experience(selfamount)self experience +amount def complete_task(selftask)self add_experience( def __str__(self)return "wallet\ {}\nexperience\ {}\nbadges +\ {} ++++++++++++++++formatself walletself experience"\njoin(str(xfor in self badges]class wallet(object)def __init__(self)self amount def increase_balance(selfamount)self amount +amount def decrease_balance(selfamount)self amount -amount def complete_task(selftask)self increase_balance( def __str__(self)return str(self amount