Lesson contents

Store a value

Give a number a name so you can use it again.

Simple example

Start5
Result5
lesson.jl
function main()
    seats = 5
    println(seats)
end

main()
Output
5
Advertisements

Everyday examples

A bus has 12 seats. Five are taken. How many seats are free?

Start12 − 5
Result7
lesson.jl
function main()
    seats = 12
    taken = 5
    println((seats - taken))
end

main()
Output
7
Run the example
Terminal
julia lesson.jl
Official documentation