MCPcopy Index your code
hub / github.com/geekcomputers/Python / findLinear

Function findLinear

QuadraticCalc.py:7–14  ·  view source on GitHub ↗
(numbers)

Source from the content-addressed store, hash-verified

5
6
7def findLinear(numbers): # find a & b of linear sequence
8 a = numbers[1] - numbers[0]
9 a1 = numbers[2] - numbers[1]
10 if a1 == a:
11 b = numbers[0] - a
12 return (a, b)
13 else:
14 print("Sequence is not linear")
15
16
17sequence = []

Callers 1

QuadraticCalc.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected