Why is the apple's position 90?

Why is the apple’s position 90 in the Unit 3 assessment? How can I explain this to my students.
Consider the following program (blocks and text)

What is the apple’s x position at the end of this program?

Hi dlgleason,
Even though the apple’s :apple: position is initially 20, it is then updated by the value of the banana :banana: , which is 60 and then added 30, giving you the resulting value of 90.

1 Like

By the way, welcome to our community! :wave:t3:

If they thought it was 100, the explanation would be that the computer does the computation line by line. When it gets to line 3 it replaces apple.x with the current value of banana.x, which is 60, +30. It does not look ahead to the final value of banana.x in line 4.