Beginner Ruby
Q28 / 100

How do you define a constant in Ruby?

Correct! Well done.

Incorrect.

The correct answer is B) A variable name starting with an uppercase letter, e.g. NAME = "value"

B

Correct Answer

A variable name starting with an uppercase letter, e.g. NAME = "value"

Explanation

In Ruby, identifiers starting with an uppercase letter are treated as constants by convention (modifiable but triggers a warning).

Progress
28/100