Arithmetic Formatter project from freeCodeCamp. View full directions here.
Uses function "arithmetic_arranger" to re-format arithmetic operations from a linear to column format.
Instructions:
-
takes a list of strings as input (five strings maximum), where each string is an arithmetic problem
-
optional second input 'True'. If set, returns solution of arithmetic problem
Sample input: arithmetic_arranger(["32 + 698", "3801 - 2", "45 + 43", "123 + 49"], True)
-
allowed operations: addition ('+') or substraction ('-')
-
input numbers cannot be longer than four digits