The __repr__
method within a class decides how the class instance is displayed as a string. Modifying it can change the output format of a class instance when printed.
Given below is a __newrepr__
function and a Person class. Modify new_format
decorator to replace the __repr__
function with __newrepr__
. Use the decorator on the person class and print the result.