My First Method

suggest change

Overview

Create a new file named my_first_method.rb

Place the following code inside the file:

def hello_world
  puts "Hello world!"
end

hello_world() # or just 'hello_world' (without parenthesis)

Now, from a command line, execute the following:

ruby my_first_method.rb

The output should be:

Hello world!

Explanation

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents