Tin

Examples · learn/02-values · 78 of 339

types

examples/learn/02-values/types.tintin run examples/learn/02-values/types.tin
fn main() {
  let year = 2026          // int: a whole number
  let price = 4.5          // float: a number with a fractional part
  let open = true          // bool: true or false
  let city = "Lisbon"      // string: text
  print("{year} {price} {open} {city}")

  let count: int = 3       // you can write the type when it helps a reader
  let ratio: float = 2     // a whole-number literal can be a float
  print("{count} {ratio}")
}