/arithmetic-formatter

freeCodeCamp: Build an Arithmetic Formatter Project

Primary LanguagePython

Students in primary school often arrange arithmetic problems vertically to make them easier to solve. For example, "235 + 52" becomes:

   235
 +  52
 -----

Finish the arithmetic_arranger function that receives a list of strings which are arithmetic problems, and returns the problems arranged vertically and side-by-side. The function should optionally take a second argument. When the second argument is set to True, the answers should be displayed.

For 5 problems with result enabled:

   32         1      45      123      988
- 698    - 3801    + 43    +  49    +  40
-----    ------    ----    -----    -----
 -666     -3800      88      172     1028

main.py - my own tryhards

chat.py - ChatGpt output - simplified version