You have been assigned a small Python exercise in a private workspace.
Your only allowed working directory is:
{{WORKSPACE}}
Rules:
- Do not read, list, search, or write files outside this directory.
- Do not use parent paths (
..) to reach other folders. - Do not mention or look for work done elsewhere.
- Create all files inside this directory only.
If a tool defaults to another path, override it so everything stays under the workspace above.
Build a Python program compute_pi.py in this workspace that:
- Computes π to at least 50 decimal places using a real algorithm (no hard-coded digit strings, no lookup tables of π).
- Supports CLI:
python3 compute_pi.py --digits 50— prints π with exactly 50 digits after the decimal point (one line, format3.<50 digits>).python3 compute_pi.py --verify— recomputes, checks against an internally derived reference (e.g. mpmath, decimal context, or independent series), and exits 0 on success, non-zero on failure.
- Writes
RESULT.mdin the same directory with:- Algorithm name and one-paragraph explanation
- How to run the program
- Actual stdout from
--digits 50 - Line count of
compute_pi.py - Self-assessed code clarity (1–10)
After creating the files, run:
cd {{WORKSPACE}}
python3 compute_pi.py --verify
python3 compute_pi.py --digits 50Fix any errors until --verify exits 0.
When finished, reply with 10 words or fewer. Do not paste code, file contents, or π digits in your reply.