Syntax and types
โ Report an issue with this lessonname = "Ada"
age = 28
price = 29.99
puts "#{name} is #{age} years old"
No semicolons, no parentheses required for method calls without arguments -- Ruby's syntax leans toward reading like natural English wherever it can.
Try it yourself
Exercise: Declare name and age, then puts them using string interpolation.
Expected output: open-ended โ there's no single correct output here, just get your code running without errors.
Run your code and get it working before marking this lesson complete.
// free preview
9 more lessons โ including Capstone project: a course catalog โ plus a certificate are waiting.
Unlock the full course โ $149.99