mirror of
https://github.com/ossu/computer-science.git
synced 2024-12-27 08:19:35 -05:00
add the filter pattern - 1.1.3
This commit is contained in:
parent
ef234d5e75
commit
437989c4b0
Binary file not shown.
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user