In Rust, variables are used to store and manipulate data throughout your program. By default, they are immutable, meaning their values cannot be changed after they are declared. However, you can create mutable variables by adding the mut keyword when declaring them. Variables in Rust are strongly typed, so the compiler will infer the type of the variable based on the value it is assigned, or you can explicitly specify the type using a type annotation.
This code example demonstrates how to declare and use variables in Rust, including immutable and mutable variables, type inference, type annotations, and tuples for storing multiple variables.