bilingual-math-code-verification-v1 / code /math_code_010_verify.py
efe-T's picture
Upload folder using huggingface_hub
93237a0 verified
Raw History Blame Contribute Delete
615 Bytes
from fractions import Fraction
defective, nondefective = 20000, 980000
one_defective = defective * 95 // 100
one_nondefective = nondefective * 10 // 100
two_defective = one_defective * 95 // 100
two_nondefective = one_nondefective * 10 // 100
assert (one_defective, one_nondefective) == (19000, 98000)
assert (two_defective, two_nondefective) == (18050, 9800)
result = {"one_positive": str(Fraction(one_defective, one_defective + one_nondefective)),
"two_positives": str(Fraction(two_defective, two_defective + two_nondefective))}
import json
print(json.dumps(result, ensure_ascii=False, sort_keys=True))