Variables

Bind a name to a value with let and let mut.

let and let mut

let creates an immutable binding. Use let mut when the value must change. Shorthand inside functions: mut x = 0.

fn main() {
    let name = "Sam"
    let mut score = 0
    score = score + 10
    print(score)
}

Output

10