โ† Ruby Programming learning path
Ruby Programming ยท Module 2 of 10

Variables, types and strings

Ruby is dynamically typed; values carry their type.

๐Ÿ“– Key ideas

  1. name = "Asha" creates a variable; no type keyword is needed.
  2. Common types: Integer, Float, String, Symbol, true/false, nil.
  3. String interpolation: "Hello, #{name}!" works in double quotes only.
  4. Symbols like :active are lightweight, reusable names.
  5. nil means "no value"; only nil and false are falsy.
๐Ÿ’ก Real-life example: Like labelled jars: the label is the variable name, and the jar knows whether it holds rice, sugar or nothing at all.
nilRuby's "no value"
SymbolA lightweight name like :active
InterpolationInserting values with #{ }
FloatA decimal number