I am trying to write a function that calls another function repeatedly. This is what I have so far:
def function1(n, function_object):
if n > 0:
function_object
function1(n-1, function_object)
def function2(x, word):
for i in range(x):
print word
y = 'pluto'
function1(3, function2(3, y))
This is what I get when I try to run it:
>>>
pluto
pluto
pluto
>>>
I thought it would print 'pluto' nine times, but it seems that function2 is only executing once. How can I get it to execute repeatedly inside function1?