Sobes.tech
Junior — Senior

Implement a function to evaluate an arithmetic expression

livecode

Task condition

Create a function that takes a string containing a simple mathematical expression (e.g., "2+3"). The function should evaluate the expression and return its value. If division by zero occurs during evaluation, the function should return -1.

Example: Input: "2+3" Output: 5

Implement a function to evaluate an arithmetic… - sobes.tech