Ad

a very simple calculator

Code
Diff
  • calc = lambda eq: eval(eq)
    
    
    • calc = lambda func, n1, n2: eval(f'{n1}{func}{n2}') if func in ['+', '-', '*', '/'] else None
    • calc = lambda eq: eval(eq)