In python 3, is there a way to check if another function executed a particular function? I want the computer to do something if a function was called by the itself and something else if another function called it. Here is an example:
def x():
y()
def y():
"""Psuedocode --->"""
if function y was called by function x:
print ("function y was called by another function")
elif function y was not called by function x:
print ("function y was called not called by another function")
Input ----> x()
Output ---> function y was called by another function
Input ---> y()
Output ---> function y was not called by another function