Bite 159. Create a simple calculator

In this Bite you will create a simple calculator. It takes a string of num1 operator num2 which you convert into its calculation returning its result. Complete simple_calculator to that end supporting +, -, * and / ("true" division so 2/3 = .66 rather than 0).

So passing '2 * 3' into the function it would return 6, '2 + 6' results in 8, '-5 * -11' = 55 and lastly '1 / 5' = 0.20.

For any bad data passed into the function (e.g. a / 3, 2 * b, 1 ^ 2, etc), you should raise a ValueError.

Good luck and have fun!

Will you be Pythonista #17 to crack this Bite?
Average Bite difficulty 1-10 rating: 3.0
» You can do it! 😌

Github login button
We use Python 3.7