first commit
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
from task7 import find_modified_max_argmax
|
||||
|
||||
print(find_modified_max_argmax([1, 3, 4, 4.5], lambda x: x**2)) # (16, 2)
|
||||
print(find_modified_max_argmax(["a", 4.5], lambda x: x*10)) # ()
|
||||
@@ -0,0 +1,4 @@
|
||||
def find_modified_max_argmax(L, f):
|
||||
L = [f(x) for x in L if type(x) == int]
|
||||
|
||||
return L and (max(L), L.index(max(L))) or ()
|
||||
@@ -0,0 +1,4 @@
|
||||
def find_modified_max_argmax(L, f):
|
||||
L = [f(x) for x in L if type(x) == int]
|
||||
|
||||
return (max(L), L.index(max(L))) if L else ()
|
||||
Reference in New Issue
Block a user