name = “Saim” # String
age = 25 # Integer
height = 5.9 # Float
is_student = true # Boolean
puts “Name: #{name}, Age: #{age}, Height: #{height}, Student: #{is_student}”
Ruby is dynamically typed → no need to mention string, int, etc.
{} → used inside strings for interpolation (inserting values).
Output:
Name: Saim, Age: 25, Height: 5.9, Student: true
Leave a Reply