File size: 431 Bytes
93237a0
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
from fractions import Fraction
total = 5 * 5 * 4 * 3
ending_zero = 5 * 4 * 3
ending_five = 4 * 4 * 3
divisible = ending_zero + ending_five
intersection = 4 * 3 + 4 * 3
result = {"total": total, "divisible": divisible,
          "p_divisible": str(Fraction(divisible, total)),
          "p_first_one_given_divisible": str(Fraction(intersection, divisible))}
import json
print(json.dumps(result, ensure_ascii=False, sort_keys=True))