Ruby - Methods
What is the output of this Ruby code?
def greet(name = "Guest")
"Hello, #{name}!"
end
puts greet
puts greet("Alice")def greet(name = "Guest")
"Hello, #{name}!"
end
puts greet
puts greet("Alice")15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions