Print FooBar Alternately

Problem Statement You&rsquo;re given the FooBar class: class FooBar : def __init__ ( self , n ): self . n = n def foo ( self , printFoo : 'Callable[[], None]' ) -> None : for _ in range ( self . n ): printFoo () def bar ( self , printBar : 'Callable[[], None]' ) -> None : for _ in range ( self . n ): printBar () &hellip; and the same instance of FooBar will be passed to two different threads.…