Variables in Ruby
Explore the fundamentals of variables in Ruby, including how to store values, print them, and follow standard naming conventions like snake case. Understand important rules for naming variables to write clear and maintainable Ruby code.
We'll cover the following...
A lot of material was covered in the previous lessons. Hopefully, all of that information was not overwhelming and we don’t feel confused about the right way to run our Ruby program. Now, let’s jump to learning something fun.
What is a variable?
A variable is a place inside our computer’s memory where we can store a value. It’s like a cell in a honeycomb. This piece of information may beg the question: Why do we need to store values? The storing of values is convenient, because it provides us with the option to go back and read values , or even modify them if the need arises. We are not obligated to modify the values of our variables. Sometimes, we can introduce some variables to improve the readability of our program.
Oftentimes, ...