fork download
  1. import ast
  2. import math
  3.  
  4. x = [([],
  5. ('a0*x**e2+c1', 'a0,c1,e2', 386204515993801.9, [0.00049594366, 1.0, 2.72403],10)]
  6. func = 'a0*x**e2+c1'
  7. if(func.find("x**")):
  8. expx = func[func.find("x**")+3]
  9. if(not(expx.isdigit())):
  10. expx = func[(func.find("x**")+3):(func.find("x**")+5)]
  11. else:
  12. if (func[func.find("x**")+4] == '.'):
  13. expx = func[(func.find("x**")+3) :(func.find("x**")+6)]
  14. expx = ast.literal_eval(expx)
Runtime error #stdin #stdout #stderr 0.02s 118656KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
  File "prog.py", line 4
    x = [([],
        ^
SyntaxError: parenthesis is never closed