Skip to content

The purpose of this academic project was to simulate (using Python) how computer languages computes arithmetic expressions and functions (ex: var= z + 3 * factorial (7)).

Notifications You must be signed in to change notification settings

adityapatelgithub/Expressions-and-Functions

Repository files navigation

Expressions-and-Functions

The purpose of this academic project was to simulate (using Python) how various computer languages computes arithmetic expressions and functions (ex: var= z + 3 * factorial (7)).

If you are interested to see what this project does, clone this repository. Then run evaluate.py. In the IDLE, you can use the following commands:

  1. evaluate an expression by: evaluate("1+2 -3*4/ 2")
  2. evaluate an expression and store it in variable: evaluate("var3 = 2+ 4-1*2")
  3. reuse stored variable: evaluate("var3 * 4")
  4. Evalute conditionals and booleans: evaluate("var3>1 and 4>1 ? a = 4 : b = 1")
  5. Define functions: evaluate("deffn abs(x) = x > 0 ? x : 0-x")
  6. Use functions once defined: evaluate("abs(21-22)")

About

The purpose of this academic project was to simulate (using Python) how computer languages computes arithmetic expressions and functions (ex: var= z + 3 * factorial (7)).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages