mirror of
https://github.com/ossu/computer-science.git
synced 2024-10-01 01:26:01 -04:00
filter pattern in 1.1.3
This commit is contained in:
parent
4570e40f5c
commit
ef234d5e75
Binary file not shown.
@ -51,4 +51,14 @@ def find(target, items):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
# The extreme pattern
|
||||||
|
largest = items[0]
|
||||||
|
for i in range(1, len(items), 1): # start comparing at index 1
|
||||||
|
if items[i] > largest:
|
||||||
|
largest = items[i]
|
||||||
|
|
||||||
|
# The filter pattern
|
||||||
|
def extractEvens(items):
|
||||||
|
for i in range(0, len(items), 1):
|
||||||
|
if (isEven(items[i])):
|
||||||
|
evens = evens + [items[i]] # array concatenation
|
||||||
|
Loading…
Reference in New Issue
Block a user