Skip to content
Course map | Lesson 4 of 5

Getting Started · 1.4

Mutable Variables

All lessons are open — jump whenever you need.

By default, variables are immutable. To create a variable that can be modified, use mut:

let mut counter = 0
counter = counter + 1
counter = counter + 1
print(counter) // 2

Goal: Create a counter, increment it 3 times and print the final value (3).

lesson-1-4.zolo
Program output

Run the code to see the output

Global index

Find your way through Zolo

Try an idea

Start here

9 results

9 results

enespt-br