Use
Look into
Ctrl+shift+v
when paste in code to preserve indentation.(Dec-10-2017, 02:56 PM)meems Wrote: ahahaha, i beat the systemGood hack,but there is a normal way to solve this in Python.
Look into
*args
and **kwargs
.def times(x, y): return y * x def apply_func(f, *args): return f(*args) print(apply_func(times,2,3))
Output:6
def test(a, b): print(a + b) def apply_func(func, **kwargs): for i in range(5): func(*tuple(value for _, value in kwargs.items())) if __name__ == '__main__': apply_func(test, a=2, b=8)
Output:10
10
10
10
10