You should not pass the call function hi() to the loop() function, This will give the result.
def hi():
print('hi')
def loop(f, n): #f repeats n times
if n<=0:
return
else:
f()
loop(f, n-1)
loop(hi, 5) # Do not use hi() function inside loop() function