add the filter pattern - 1.1.3

This commit is contained in:
Eric Douglas 2014-05-24 05:25:56 -03:00
parent ef234d5e75
commit 437989c4b0
2 changed files with 5 additions and 1 deletions

View File

@ -60,5 +60,9 @@ for i in range(1, len(items), 1): # start comparing at index 1
# The filter pattern
def extractEvens(items):
for i in range(0, len(items), 1):
if (isEven(items[i])):
if isEven(items[i]):
evens = evens + [items[i]] # array concatenation
return evens
## Add isEven function
def isEven(value):