fork download
  1. def fSolve (x): #solve equation f(x) where you decide on x
  2. fx = x**2 + x-3
  3. gSolve
  4. return fx
  5.  
  6. def gSolve(fx): #solve equation using f(x)
  7. gx = (2*fx)**2 - 2*fx-3
  8. return gx
  9.  
  10.  
  11. #print stuff if u wish
  12. print(f'g(1) = {gSolve(fSolve(1))}')
  13. print(f'g(3) = {gSolve(fSolve(-3))}')
Success #stdin #stdout 0.02s 9204KB
stdin
Standard input is empty
stdout
g(1) = 3
g(3) = 27