convert math equation from string to int 1

convert math equation from string to int

a = '10 * 10'
print(eval(a))

Here is what the above code is Doing:
1. We are creating a variable called a and assigning it the value of ’10 * 10′.
2. We are then printing the value of a.
3. We are then using the eval() function to evaluate the value of a.
4. The eval() function then evaluates the value of a and prints it.

Similar Posts