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

Function coprime_alternate

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

Source from the content-addressed store, hash-verified

103
104print("Example 7")
105def coprime_alternate(a, b):
106 is_coprime = True
107 for i in range(2, min(a, b) + 1):
108 if a % i == 0 and b % i == 0:
109 is_coprime = False
110 break
111 return is_coprime
112
113assert coprime_alternate(4, 9)
114assert not coprime_alternate(3, 6)

Callers 1

item_019.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected