Program - function to print the source code of a function


Topic: Program - function to print the source code of a function

Solution

def print_so(f: "Function name/class name/module"):
    from inspect import getsource
    print(getsource(f))



List all Python Programs