My code works exactly as it is supposed to, print to the console shows appropriate string but CC is not letting me go further, what’s going on?
def remove(filename, *args, **kwargs):
with open(filename) as file_obj:
text = file_obj.read()
for arg in args:
text = text.replace(arg, '******')
for kwarg, replacement in kwargs.items():
text = text.replace(kwarg, replacement)
print(remove("text.txt", "generous", "gallant", fond="amused by", Robin="Mr. Robin"))
If you open the _test.py file, you can see the problem. The only test is whether your ‘transformed’ text referred to as given is exactly the same as the expected text referred to as answer. If you re-read the last part of instruction one, I think you’ll find the difference.