I am to return a function such that:
add1 = make_adder(1)
add1(5)
#Result: 6
make_adder(5)(10)
#Result: 15
I currently have
def make_adder(n):
return lambda n: n+1
add1 = make_adder(1)
** Mistake noted!!*
BUT I have another similiar question where I need to check where the numbers match each other.
def is_same(x,y):
return x == y
def make_verifier(key):
return lambda n: is_same(262010771,key )
check_password = make_verifier(262010771)
If the key is having a different number, I am supposed to get a False, but I do not get where it is wrong