Variables

Variables are immutable by default.

fn main() {
  x = 5
  name = "alice"

Use mut to make a variable mutable.

  mut y = 10
  y = 20

Type annotations are optional but supported.

  count: int = 42
  label: str = "hello"

Printing uses println. String interpolation uses {} inside double quotes.

  println("x is {x}")
  println("y is {y}")
  println("{label}: {count}")
}
$ pyr run variables.pyr
x is 5
y is 20
hello: 42