0

how to know the order of execution?

1- def boo(a,b): 2- a+=2 3- b-=2 4- y=foo(a,b) 5- return y 6- def foo(a,b): 7- y=(a+b)/2 8- return y 9- result=boo(4,6) 10- print(result)

5th Dec 2016, 5:15 AM
Jacob
1 Réponse
+ 2
just follow the flow: you call boo(4,6) then it calls foo (6,4) foo returns 5 --- then boo continues and return y (wich was 5). result is 5
5th Dec 2016, 5:35 AM
Nahuel
Nahuel - avatar