def main(sc, *args):
    slices = int(args[0]) if len(args) > 0 else 2
    N = 100000 * slices

    count  = sc.parallelize(xrange(N), slices).map(estimate)
    count  = count.reduce(add)

    print (4.0 * count / N) % "Pi is roughly %0.5f"
    sc.stop()
dataset/ETHPy150Open DistrictDataLabs/spark-workshop/apps/pi.py/main/swapped operands of `%`