{"slug":"log-solve","tier":1,"subject":"precalculus","title":"Log Solver","description":"Solve log_b(x)=v for x.","files":[{"filename":"LOGSOLVE.py","content":"def p(s):print(s)\ndef o1():\n p(\"=LOG SOLVE=\")\n b=float(input(\"b:\"))\n v=float(input(\"v:\"))\n x=b**v\n p(\"x=\"+str(x))\ndef menu():\n while True:\n  p(\"=LOGSOLVE=\")\n  p(\"1:SOLVE X\")\n  p(\"0:EXIT\")\n  c=input(\"?>\")\n  if c==\"1\":o1()\n  elif c==\"0\":break\nmenu()"}],"testCases":[{"id":"log10-of-x-eq-2","inputs":["1","10","2","0"],"expectedContains":["x=100"]},{"id":"log2-of-x-eq-3","inputs":["1","2","3","0"],"expectedContains":["x=8"]}],"usage":"Solves `log_b(x) = v` for `x` using `x = b^v`.\n\nLaunch `LOGSOLVE` from `prgm`, choose `1:SOLVE X`, then:\n\n1. `b:` — the base of the log.\n2. `v:` — the value on the right side of the equation.\n\nOutput is `x=`. Use decimals for non-integer bases (e.g. `b=2.71828` for natural log).","example":{"problem":"Solve `log₂(x) = 3`.","walkthrough":"1. Run `LOGSOLVE`, choose `1:SOLVE X`.\n2. `b:` → **2**, `v:` → **3**.\n3. Output: `x=8`.\n\nVerify: log₂(8) = 3 because 2³ = 8. ✓"}}