mirror of
https://github.com/ossu/computer-science.git
synced 2025-07-02 02:06:54 -04:00
add the filter pattern - 1.1.3
This commit is contained in:
parent
ef234d5e75
commit
437989c4b0
2 changed files with 5 additions and 1 deletions
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…
Add table
Add a link
Reference in a new issue