Arithmetic Operation 🟡
Contents
Arithmetic Operation 🟡#
Create a function that receives a list of strings that are arithmetic problems and returns the answers.
Rules#
Input should be a list of string(s).
Every string should have a integer number, an operator (+ or -), and another integer number - all separated by a single space.
The function should return a list of integer(s), where every integer is the solution for the respective arithmetic operation.
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]