class scissors(thing)pass many branches first purely imperative version this is going to have lot of repetitivenestedconditional blocks that are easy to get wrongdef beats(xy)if isinstance(xrock)if isinstance(yrock)return none no winner elif isinstance(ypaper)return elif isinstance(yscissors)return elseraise typeerror("unknown second thing"elif isinstance(xpaper)if isinstance(yrock)return elif isinstance(ypaper)return none no winner elif isinstance(yscissors)return elseraise typeerror("unknown second thing"elif isinstance(xscissors)if isinstance(yrock)return elif isinstance(ypaper)return elif isinstance(yscissors)return none no winner elseraise typeerror("unknown second thing"elseraise typeerror("unknown first thing"rockpaperscissors rock()paper()scissors(beats(paperrockbeats(paper typeerrorunknown second thing delegating to the object as second try we might try to eliminate some of the fragile repitition with python' "duck typing"--that ismaybe we can have different things share common method that is called as needed callables