There are a few problems with the code. As mentioned before, the code as posted cannot run. I copied your code and when I try to run it Python complains about "Invalid Syntax" and highlights the end of line 1. I know functions need a colon, so I added the colon and tried again.
def hi (a, b):
return a * b
def hello (a, b):
return hi(a, b + 1)
hello(4, 2)
Now Python complains about "expected an indented block" and highlights the start of line 2. I know the code inside a function needs to be indented, and I also know a lot of time code is posted without surrounding the code with python tags so I indented the code and tried again.
def hi (a, b):
return a * b
def hello (a, b):
return hi(a, b + 1)
hello(4, 2)
Now I run the code and I don't get any errors, but I also don't get any output. I added a print statement to see what hello() returns.
def hi (a, b):
return a * b
def hello (a, b):
return hi(a, b + 1)
print(hello(4, 2))
This program prints 12 when run. This makes me think you and I are not running the same code. Your code not having a print statement is also suspicious. Are you typing in Python commands at the '>>>' prompt or are you running a Python program saved in a file. I decide to see what happens if I type you code in at the Python '>>>' prompt.
Output:
>>> def hi(a, b):
return a*b
>>> def hello(a, b):
return hi(a, b+1)
>>> hello(4, 2)
12
Hmmm. I am getting 12 back when I call hello(4, 2). When you look at what I tried, how does it differ from what you are doing?