Complete the code to declare a mutable variable named count with initial value 5.
let [1] count = 5;
var instead of let.mut for mutability.const which creates an immutable constant.In Rust, to declare a mutable variable, you use let mut. The keyword mut makes the variable mutable.
Complete the code to change the value of the mutable variable score to 10.
let mut score = 5; score [1] 10;
== instead of = for assignment.=> which is not valid here.To assign a new value to a mutable variable in Rust, use the single equals sign =.
Fix the error in the code by making the variable name mutable so it can be changed.
[1] name = "Alice"; name = "Bob";
mut without let.const which is immutable.var which is not valid in Rust.In Rust, to declare a mutable variable, you write let mut before the variable name.
Fill both blanks to create a mutable variable temperature and assign it the value 25.
[1] [2] temperature = 25;
var which is not valid in Rust.const which creates an immutable variable.let and mut.The correct way to declare a mutable variable in Rust is let mut followed by the variable name.
Fill all three blanks to declare a mutable variable speed, assign it 30, and then update it to 50.
[1] [2] speed = 30; speed [3] 50;
const instead of let.mut to allow changing the variable.== instead of = for assignment.Declare a mutable variable with let mut, assign initial value with =, and update it with =.