class ExtraCommands: @staticmethod def do_greet(args): """Greet someone: greet """ name = args if args else "World" return f"Hello, {name}!" @staticmethod def do_reverse(args): """Reverse a string: reverse """ return args[::-1] @staticmethod def do_count(args): """Count words in a string: count """ return str(len(args.split())) commands = { 'greet': ExtraCommands.do_greet, 'reverse': ExtraCommands.do_reverse, 'count': ExtraCommands.do_count, } def get_commands(): return commands