Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Paste your function here
- def applyF_filterG(L, f, g):
- foundany = 1
- #!Remove all fails
- while foundany != 0:
- foundany = 0
- pos = 0
- for i in L:
- if type(i) != int:
- foundany = 1
- del L[pos]
- else:
- integeri = int(i)
- integeri = int(f(integeri))
- integeribool = g(integeri)
- if integeribool == False and foundany == 0:
- foundany = 1
- del L[pos]
- pos += 1
- #!Return the goods
- if len(L) == 0:
- return -1
- else:
- return max(L)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement