Arithmetic Operation 🟡#

Create a function that receives a list of strings that are arithmetic problems and returns the answers.

Rules#

  1. Input should be a list of string(s).

  2. Every string should have a integer number, an operator (+ or -), and another integer number - all separated by a single space.

  3. The function should return a list of integer(s), where every integer is the solution for the respective arithmetic operation.

  4. For any non-valid operation, the result should be None.

Example#

Function Call

arithmetic_solver(["32 + 698", "3801 - 2", "45 + 43", "123 * 49"])

Return:

[730, 3799, 88, None]

Content#