from random import getrandbits def RandomBool(): return bool(getrandbits(1))
- from random import getrandbits
class RandomBool(object):def __init__(self):self.b = bool(getrandbits(1))def __repr__(self):return f'{self.b}'- def RandomBool():
- return bool(getrandbits(1))
import codewars_test as test from solution import RandomBool @test.describe("Example") def test_group(): @test.it("test case") def test_case(): test.assert_equals(RandomBool() in [True, False], True)
- import codewars_test as test
- from solution import RandomBool
- @test.describe("Example")
- def test_group():
- @test.it("test case")
- def test_case():
test.assert_equals(RandomBool().b in [True, False], True)- test.assert_equals(RandomBool() in [True, False], True)