What are Variables?

Learn about variables and variable assignments.

Naming things

To refer to the objects our program deals with, we want to assign names to them. Every practical programming language has a feature to do this, called variables. In Ruby, there are different types of variables that we’ll explore soon.

Variable assignment

In Ruby, we can give a name to something (an object) by using the so-called assignment operator, =, like so:

number = 1

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy