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

Function coprime

example_code/item_019.py:94–98  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

92
93print("Example 6")
94def coprime(a, b):
95 for i in range(2, min(a, b) + 1):
96 if a % i == 0 and b % i == 0:
97 return False
98 return True
99
100assert coprime(4, 9)
101assert not coprime(3, 6)

Callers 1

item_019.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected