MCPcopy Create free account
hub / github.com/geekcomputers/Python / solve

Function solve

chicks_n_rabs.py:11–17  ·  view source on GitHub ↗
(num_heads, num_legs)

Source from the content-addressed store, hash-verified

9
10
11def solve(num_heads, num_legs):
12 ns = "No solutions!"
13 for i in range(num_heads + 1):
14 j = num_heads - i
15 if 2 * i + 4 * j == num_legs:
16 return i, j
17 return ns, ns
18
19
20if __name__ == "__main__":

Callers 1

chicks_n_rabs.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected