Ruby - Methods
What will be the output of this Ruby code?
def greet(name)
"Hello, #{name}!"
end
puts greet("Alice")def greet(name)
"Hello, #{name}!"
end
puts greet("Alice")greet takes a parameter name and returns a string with the name inserted.puts greet("Alice")15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions