[python] How to calculate a mod b in Python?