给定一个从2到n到其自身的函数f,判断函数f是否有反函数?用Python做
def f(x): return math.fabs(x) x=int(input()) if f(x)==f(-x): print("f是反函数") else: print("f不是反函数")