MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / repeated_is_heads

Function repeated_is_heads

example_code/item_023.py:99–101  ·  view source on GitHub ↗
(count)

Source from the content-addressed store, hash-verified

97
98print("Example 7")
99def repeated_is_heads(count):
100 for _ in range(count):
101 yield flip_is_heads() # Generator
102
103all_heads = all(repeated_is_heads(20))
104assert not all_heads

Callers 1

item_023.pyFile · 0.85

Calls 1

flip_is_headsFunction · 0.85

Tested by

no test coverage detected