Go Back

file-operations

Getting to Know Ruby: Day 2

August 21, 2020
ruby
basics
file-operations
comments

Day 2 here we go! Constants Constants in ruby begin with a capital or upper case letter. Unlike some programming languages ruby allows users to change constants after declaration except it will give you a warning for it. irb(main):001:0> Constant = 78.1 => 78.1 irb(main):002:0> Constant = 54.9 (irb):2: warning: already initialized constant Constant (irb):1: warning: previous definition of Constant was here => 54.9 irb(main):003:0> puts Constant 54.