I need to optimize my number of lines by making one function instead of several i want to have an output :
0 0
0 1
0 2
0 3
0 4
and as few functions as possible. I need to call it by function 1 that i don't have access to.
my code looks like this:
# I have a direct access to this function and I want to call it by giving it val and other_val
def f0(val, other_val=None):
print(val, other_val)
# I don't have a direct access to this function because it's in a library
def f1(function):
function(0)
if __name__ == '__main__':
# I need to call this specific function and pass other_val aswell but can't because f1 is in a library
f1(f0) # other_val = 0
f1(f0) # other_val = 1
f1(f0) # other_val = 2
f1(f0) # other_val = 3
f1(f0) # other_val = 4