Directions

This self test will test you on the basics of using variables and a few math operations. Try answering these without using the interpreter first. If you get stuck, think about how Snap! would work, and then try again.



What is the value of x, at the end of the script?

>>> x = 3 + 2
>>> x = x - 3
>>> y = 5
>>> x = x + y
            
2
7
5
10
What is the value of x?

>>> y = 3
>>> z = 2
>>> x = y % z
                
2
1
3.5
4.5
What is a correct way to switch the values of the variables x and y?

>>> x = 3
>>> y = 7
            

>>> x = y
>>> y = x
                

>>> temp = x
>>> x = y
>>> y = temp
                    

>>> x = y
>>> temp = x
>>> y = temp