STEM with Python – Part 2: Algebra – Evaluating Expressions

The first step into the algebra universe with Python.

Given the fact that I’ve been continuing on my journey of Algebra on this blog as well, programming languages’ compatibility with mathematical contraction is finally colliding with Algebra in my universe.

It appears that my curiosity about STEM doesn’t know its end for now. Given the fact that I’ve been continuing on my journey of Algebra on this blog as well, programming languages’ compatibility with mathematical contraction is finally colliding with Algebra in my universe.

Also, during this series, STEM with Python, I’m planning to try as many concepts as I can think of. Last time, I mentioned how you can connect Pythion with the MySQL database, and I may go back to the previous DB topic in the future. The core concept of this blog is being experimental all the time!

Here, I coded Algrebra’s most basic concept – Evaluating Expressions – in Python.

image 01

Actual code:

a = int(input("What is the vakue of a? "))
b = int(input("What is the vakue of b? "))
x = int(input("What is the vakue of x? "))

def eval_exp(a,b,x):
    exp_eval = a + b * x
    return exp_eval

exp_value = eval_exp(a,b,x)

print(f"The value of expression is {exp_value}")

Executed result:

image 02

Leave a Reply