← Back to challenges

Fix the Right Answer

PythonHardmathstrings

Instructions

Create a function that takes a string and returns the right answer.

Examples

post_fix("2 2 +") ➞ 4

post_fix("2 2 /") ➞ 1

post_fix("8 4 / 9 * 3 1 * /") ➞ 54

Notes

  • The operators + - * / may be supported.
  • Output always returns an integer.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.