observer pattern class badge(object)def __init__(selfname_type)self points self name name self _type _type self awarded false def add_points(selfamount)self points +amount if self points self awarded true def __str__(self)if self awardedaward_string "earnedelseaward_string "unearnedreturn "{}{[{}]formatself nameaward_stringself points def main()wallet wallet(user user(walletuser badges append(badge("fun badge" )user badges append(badge("bravery badge" )user badges append(badge("missing badge" )tasks [task(user )task(user )task(user )for task in taskstask complete(print(userif __name__ ="__main__"main(