Exercise: Juggling Values

Coding exercise to test your learning of mutation and assignment.

We'll cover the following

Task

Due to unforeseen circumstances, some values of variables have been shifted into one another. Your task: to fix this using your newly acquired knowledge of variable mutation.

Problem statement

You are given three variables named var1, var2 and var3. Write code such that the following is satisfied:

  • var1 contains the value of var2
  • var2 contains the value of var3
  • var3 contains the value of var1

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy