Section 1 - Instruction

Previously, we looked at the rules for naming variables. Remember, variables are like labeled boxes for storing information.

If we write: let player_level = 5;

Engagement Message

What value is stored inside the player_level variable?

Section 2 - Instruction

Let's quickly recap a key naming rule: variable names cannot contain spaces.

Engagement Message

So, if you wanted a variable for a user's age, what would you use instead of user age?

Section 3 - Instruction

An important thing about variables is that their values can change! However, in Rust, you need to explicitly make a variable mutable (changeable) by using the mut keyword.

Example:

Engagement Message

What value does the level variable hold after the third line (level = 2;) is run?

Section 4 - Instruction

Variables are especially useful when working with numbers because you can perform calculations with them.

Rust uses familiar symbols for math: + for addition, - for subtraction, * for multiplication, and for division.

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal