Created
November 14, 2011 19:54
-
-
Save pamolloy/1364954 to your computer and use it in GitHub Desktop.
Project Euler problem 1 - A function for a generalized solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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