Datasets:
Download code/math_code_001_verify.py from efe-T/bilingual-math-code-verification-v1: direct link, hf CLI and curl.
- Browser
- Download file 459 Bytes
-
https://huggingface.co/datasets/efe-T/bilingual-math-code-verification-v1/resolve/main/code/math_code_001_verify.py
- Command line
-
hf download hf://datasets/efe-T/bilingual-math-code-verification-v1/code/math_code_001_verify.py
-
curl -L -o math_code_001_verify.py https://huggingface.co/datasets/efe-T/bilingual-math-code-verification-v1/resolve/main/code/math_code_001_verify.py
459 Bytes
| from fractions import Fraction | |
| solutions = [] | |
| for low_kg in range(21): | |
| high_kg = 20 - low_kg | |
| salt = Fraction(low_kg, 10) + Fraction(3 * high_kg, 10) | |
| if salt == Fraction(18, 100) * 20: | |
| solutions.append((low_kg, high_kg, salt)) | |
| assert len(solutions) == 1 | |
| x, y, salt = solutions[0] | |
| result = {"low_kg": str(x), "high_kg": str(y), "final_salt_fraction": str(salt / 18)} | |
| import json | |
| print(json.dumps(result, ensure_ascii=False, sort_keys=True)) | |