Python: How to differ these two functions with each other
Question: 
    def a():
        """ Need to write something here."""
    
    def test1():
        return a()
    
    def test2(x):
        return x
    

I would like to do this in python interpreter:

    
    
    test1()
    
    test2(a())
    

So what I need to do is that I write a() to make these two functions (test1(),
test2(x)) return different result.

For example, I want test1 to return number 1 and test2 return other things
except number 1.


Answer: 
    import inspect
    
    def a():
        s = inspect.stack()
        if s[1][3] == '<module>':
            return "From test2"
        else:
            return "Not from test2"
    

