Methods With Arguments


#1




What is wrong with that code? I try use return like instruction said I try use puts and it still return me this :
Oops, try again.
Make sure your method has a return statement.


print "What is your name ?"
name = gets.chomp
def welcome(name)
   puts "Hello, #{name}!"
end
print welcome(name)


#2

You only need

this part and that's it! :slight_smile:


#3

Thanx, but it works only with "return" now I see it. Forgot to relode page time to time - sometimes it works better than anything :slight_smile:


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.