Getting first and last function parameter in Python
Question: I have to make a function with more than 2 arguments in python and in the end
I have to print the first and the last argument of the function (in a list).

I have tried like this, but it doesn't work. What am i doing wrong?

    
    
    import inspect
    
    def func(a, b, c):
        frame = inspect.currentframe()
        args, _, _, values = inspect.getargvalues(frame)
        for i in args:
            return [(i, values[i]) for i=0 and i=n]
    


Answer: You are overthinking this. You already have references to the first and last
arguments:

    
    
    def func(a, b, c):
        print [a, c]
    

