Datasets:
Download code/math_code_008_verify.py from efe-T/bilingual-math-code-verification-v1: direct link, hf CLI and curl.
- Browser
- Download file 494 Bytes
-
https://huggingface.co/datasets/efe-T/bilingual-math-code-verification-v1/resolve/main/code/math_code_008_verify.py
- Command line
-
hf download hf://datasets/efe-T/bilingual-math-code-verification-v1/code/math_code_008_verify.py
-
curl -L -o math_code_008_verify.py https://huggingface.co/datasets/efe-T/bilingual-math-code-verification-v1/resolve/main/code/math_code_008_verify.py
494 Bytes
| from fractions import Fraction | |
| value, difference, second_difference = 2, 3, 2 | |
| c = value | |
| a = Fraction(second_difference, 2) | |
| b = Fraction(difference) - a | |
| values = [] | |
| for n in range(1, 11): | |
| value += difference | |
| values.append(value) | |
| difference += second_difference | |
| assert values[:2] == [5, 10] | |
| result = {"coefficients": [str(a), str(b), str(c)], "f10": str(values[-1]), | |
| "sum_1_to_10": str(sum(values))} | |
| import json | |
| print(json.dumps(result, ensure_ascii=False, sort_keys=True)) | |