Ruby Syntax
Ruby needs no semicolons or parentheses for most calls. Blocks end with end. Indentation is only style. Comments start with #. Everything evaluates to a value.
Example
# comment
puts "Syntax"
puts(1 + 2)
x = if true then "yes" else "no" end
puts xResult
Syntax 3 yes
Exercise
Close a block.
if true
puts 1
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.