These codes seem the same on paper but their outcomes show they are different codes under the hood. Is it because of scope within the loop? The output shows on the first exa