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) // 2Goal: 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