Python minimalistic with barrier
One barrier is used to keep for-loops in ieach method in sync. The other barrier is used to wait for the zero to be printed.\n\n# Code\n\nfrom threading import 
One barrier is used to keep for-loops in ieach method in sync. The other barrier is used to wait for the zero to be printed.\n\n# Code\n```\nfrom threading import Barrier\n\nbarr = Barrier(3)\nbarr_zero = Barrier(2)\n\nclass ZeroEvenOdd:\n    def __init__(self, n):\n        self.n = n+1\n\n    def zero(self, printNumber: \'Callable[[int], None]\') -> None:\n        for k in range(1,self.n):\n            barr.wait()\n            printNumber(0)\n            barr_zero.wait()\n\n    def even(self, printNumber: \'Callable[[int], None]\') -> None:\n        for k in range(1,self.n):\n            barr.wait()\n            if k%2 == 0:\n                barr_zero.wait()\n                printNumber(k)\n\n    def odd(self, printNumber: \'Callable[[int], None]\') -> None:\n        for k in range(1,self.n):\n            barr.wait()\n            if k%2 > 0:\n                barr_zero.wait()\n                printNumber(k)\n```
['Python3']