Finite differences in Python (Q1085)
Jump to navigation
Jump to search
No description defined
| Language | Label | Description | Also known as |
|---|---|---|---|
| English | Finite differences in Python |
No description defined |
Statements
def diff(xs): return [b - a for a, b in zip(xs, xs[1:])]; squares = [n**2 for n in range(1, 7)]; print(diff(diff(squares)))
0 references