79835134

Date: 2025-12-01 17:41:28
Score: 0.5
Natty:
Report link
def apply_twice(func, arg):
    return (func(arg)) # argument is 10 ,that added to to value 5
def add_five(x): # func when called once add_five inside becomes 10+5=15
    return x + 5
print(apply_twice(add_five, 10))


   
def apply_twice(func, arg):
    return func(func(arg)) # argument is 10 ,that added to to value 5 now  called twice
def add_five(x):# func when called twice add_five inside becomes 10+5+5=20
    return x + 5
print(apply_twice(add_five, 10))


   
def apply_twice(func, arg):
    return func(func(arg))+ func(func(arg))# argument is 10 ,that added to to value 5 now  called twice
def add_five(x): #  two time repeated func , when called twice add_five inside becomes 10+5+5=20 +20=40
    return x + 5
print(apply_twice(add_five, 10))
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: turab nomanbhai