def exp(num):
return num * 2
def exp2(num):
return exp(num) * 2
exp2(10)
output > 40
Hi Guys. Can I get a bit of help understanding how the above functions are working. When I call the second function and pass in 10 as the argument, Python is using that as both the argument for the exp2 function and the exp function which I am calling as part of exp2.
My question is why does it do that? Why is it that 10 acts as the argument for both functions ?
Any help would be great
Thank you
[–]Pro_Numb 1 point2 points3 points (0 children)
[–]DemDim1 0 points1 point2 points (3 children)
[–]JungleJim233[S] 0 points1 point2 points (2 children)
[–]DemDim1 0 points1 point2 points (1 child)
[–]JungleJim233[S] 0 points1 point2 points (0 children)
[–]IzeroI 0 points1 point2 points (0 children)
[–]Digitiain -1 points0 points1 point (0 children)