Declaring Values with var
Create named variables in Mojo.
Why You Need Names
A program juggles many values. To reuse one later you give it a name. In Mojo you create a named value with var. 📦
Your First var
Write var, then a name, then = and a value. Mojo stores the value under that name so you can use it again.
var score = 100All lessons in this course
- Declaring Values with var
- Int, Float, and Bool
- Strings and Text
- Type Annotations That Help