Skip to content

Instantly share code, notes, and snippets.

@pamolloy
Created November 14, 2011 19:54
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 pamolloy/1364954 to your computer and use it in GitHub Desktop.
Save pamolloy/1364954 to your computer and use it in GitHub Desktop.
Project Euler problem 1 - A function for a generalized solution
def overlap(list):
"""Multiply each element by the following elements
in the list and return a list of each multiple"""
multiples = []
count = 0
for integer in list:
for index in range((count + 1), (len(list) - 1))
multiple = integer * list[index]
multiples.append(multiple)
count += 1
return multiples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment