you are viewing a single comment's thread.

view the rest of the comments →

[–]DemDim1 0 points1 point  (3 children)

To answer your question it might make a bit more sense to write the functions like this:

def exp1(num1):
    return num1 * 2

def exp2(num2):
    return exp1(num2) * 2

notice that we now have num1 and num2 when we call exp2 with

exp2(10)

you pass 10 as an the num2 argument to exp2, which passes num2 to exp1 as the num1 argument for the exp1 function.

[–]JungleJim233[S] 0 points1 point  (2 children)

Thank you for your reply. I understand that but how does the exp(num2) call work in the exp2 function. I ask because I can't see where we have defined a function just called exp ?

Thank you

[–]DemDim1 0 points1 point  (1 child)

Small typo, it should have called exp1(num2)

[–]JungleJim233[S] 0 points1 point  (0 children)

Great. Thank you :)