1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

第五回講義メモ

Last updated at Posted at 2020-12-31

!Mac OS X-10.15.7 !ruby-2.6.3p62

Hello World

第一歩目, Hello Worldを出力してみる.

Hello World

出力方法

method できること
print 出力(要改行)
puts 出力(自動改行)
p デバッグ用
pp デバッグの出力?
printf Cと同じ

puts

シングルコーテーションで括って,(シングル, ダブルどちらでも良さそう?)(追記) : Stringはシングルコーテーション'で囲うのと,ダブルで囲うのの二種類があります.シングルは中身をいじらないとき,ダブル"はちょこちょこいじるときです

puts 'Hello World'

出力コマンド(保存したrubyファイルを指定)

ruby puts_hello_world.rb

結果

Hello World

参考サイト

https://qiita.com/daddygongon/items/c51f3e0695174bb3c508


  • source ~/my_ruby/grad_members_20f/members/drop-sd/lectures/no5.org
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?