Variables
Introduction to variables and basic data types.
StartVariables
Lesson 1 of 1
- 1The “Hello, world!” program simply writes to the screen. It does not read anything, calculate anything, or allow for user input. That’s no fun! Real programs tend to produce results based on some …
- 2Suppose we are building a game, and we want to keep track of the item names and their in-game prices. We need some variables! In many cases, you will only assign a variable once, i.e. store a valu…
- 3So now you might ask, how do we print the value of a constant to the terminal? Oftentimes, we find ourselves needing to print constant values as part of a message in the terminal. In these cases, w…
- 4Computers are incredible at doing calculations. Now that we have declared variables, let’s use them with arithmetic operators to calculate things! Emojicode supports arithmetic operators for: - ➕…
- 5Sometimes in our programs, however, we need variables whose values can be modified. If you try to reassign a constant variable, this will result in a compiler error. This is where mutable variabl…
- 6In Emojicode, operator assignment provides a short-hand method for modifying the value of variables. Different compound assignment operators include: - ⬅️➕: addition assignment - ⬅️➖: subtractio…
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory