Skip to content

Instantly share code, notes, and snippets.

@danieldiekmeier
Created October 21, 2016 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danieldiekmeier/7220ab44bb68e1b665410a81ad74a31f to your computer and use it in GitHub Desktop.
Save danieldiekmeier/7220ab44bb68e1b665410a81ad74a31f to your computer and use it in GitHub Desktop.
import itertools
import math
items = [10, 3, 4, 10]
steps = 10
def make(a, b):
print(a, b)
result = []
for i in range(steps):
result.append(math.sqrt(
(((a ** 2) * (steps - i - 1))) +
(((b ** 2) * i))
) / steps)
return result
result = [make(x, y) for x,y in zip(items,items[1:])]
print(result)
print(list(itertools.chain.from_iterable(result)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment