Variable in Rust declared using keyword let and it's immutable by default

let x = 30;
println!("{}", x);

x = 50; // error will occur
println!("{}", x);

there's option to make variable mutable, using keyword mut

let mut x = 30;

x = 50;

there's another concept that called shadowing, you can declare variable with same name in the same scope

let x = 30;
println!("{}", x); // 30

let x = 50;
println!("{}", x); // 50

let x = "Fifty"; // even change the type
println!("{}", x"); // Fifty

variable can be initiated or updated during runtime

let x = 30;

let y = if x >= 30 {"Hot"} else {"Cold"};

Constant

Constant are different with variables in Rust, constant can't be initiated during runtime, there's no option to make it mutable, require type in declaration and the name should upper case / caps lock on!

const PHI = 1.618033988749895;