Core ConceptsVariables, Types & Shadowing
All courses

Immutable by default

let x = 5 is immutable. Add mut to mutate. Rust prefers you think before you change things.

Quirk — Shadowing: let spaces = " "; let spaces = spaces.len(); reuses the name but creates a new binding — even with a different type. Handy, slightly magical.

Output
Press Run to execute your code.