5th class: Output

Reference site

Chart type ruby-I (puts)

Theme: Hello world

First of all, it outputs Hello world.

Hello world.

Make sure that the output result changes depending on the characters you typed.

> ruby hello_name.rb Rudy
Hello Rudy.

Implementation example

You can output using puts.

puts "Hello world"

Click here for the incidental part.

puts "Hello #{ARGV[0]}."

note

There are several ways to output with ruby. ・ Print: Output normally, line breaks required ・ Puts: Output normally: Line breaks automatically ・ P: When launching as debugging work during coding ・ Pp: p pretty print ・ Printf: Same as c language


Recommended Posts

5th class: Output
11th class: Class
9th class: assert_equal
10th class: Recursion
8th class: rake
11th :: ruby_VI (hello class)
6th class: Variables, method
5th
6th
6th
9th
7th
11th
9th
7th
11th
10th
10th
2020/10/4 Morning output
Anonymous class (anonymous class)
2020/10/4 noon output
Special Lecture on Multi-Scale Simulation: 11th (class)
Learning output ~ 11/3 ~
Class method
2020/10/5 Morning output
ObjectMapper class
Learning output
ArrayList class
2020/10/3 Noon output
2020/10/3 Morning output