I have done this below program but I was assuming the result is 6 for numZebrasAfterTrade. But I can see 8 in the result screen so is that the right result or wrong?
I would refresh the page, and maybe even re-paste the code.
This may be reflecting some previous code.
Yes after refreshing the page I got the expected output.