0Pricing
Mojo Academy · Lesson

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 = 100

All lessons in this course

  1. Declaring Values with var
  2. Int, Float, and Bool
  3. Strings and Text
  4. Type Annotations That Help
← Back to Mojo Academy