Petrie Multiplier calculator in Python