1. 1

    In programming, we have a way of storing values so that we can reuse them throughout our program or change them, if necessary. This concept is known as a variable. Maybe you’re familiar with th…

  2. 2

    One reason we use variables is that they allow us to easily reuse values in different parts of our code. When we reuse a value, it will appear in multiple places in our code. Re-typing that val…

  3. 3

    The strong selling point of using a variable is that we can easily change their value, making our programs flexible. As we saw in the last exercise, we can save a number to a variable and reuse i…

  4. 4

    Now that you know a bit about variables, let’s code some ourselves! We create or declare a variable by giving it a name and setting it equal to a value. […] In the code editor, we’ve wri…

  5. 5

    Congrats! Now you’ve learned about variables and why they’re useful in programming. In this lesson, we learned that: - Variables allow us to store information - Variables allow us to quickly _re…

  1. 1

    Data is a basic unit in programming. Without data, we couldn’t write any programs! But what is data? We may be familiar with data as information, or facts. In computing, data is the pieces of i…

  2. 2

    Numbers are the original data type. The earliest computers communicated only in numbers, using binary computation . We no longer just program using numbers, but numbers still have special prop…

  3. 3

    But what if we want to work with data that isn’t a number? We can represent other forms of data as a string. Strings are any sequence of characters (letters, spaces, numbers, or symbols). While …

  4. 4

    This next data type has a special importance to computing. Boolean values represent the logical ideas of true and false. Booleans, unlike numbers or strings, only have two values: […] and …

  5. 5

    So far you’ve learned about three different data types: - numbers - strings - booleans Let’s put your knowledge to work! In the code editor, we’ve listed three variables, each equal to a differ…

  6. 6

    Congrats! Now you know the building blocks of most programming languages and should start to have an idea about the types of simple programs that you could write. In this lesson, we learned: - Ca…

  1. 1

    In computing, we work with lots of different forms of data. But the real fun comes when we can do something with this data. In this lesson, we’ll look at how we can write short computer program…

  2. 2

    Think about the last time you needed to perform long division — did you write it out on paper or reach for a calculator? We can actually write computer programs that perform calculations for …

  3. 3

    When writing a program, we often need to check if a value is correct or compare two values. Comparison operators allow us to compare values and evaluate their relationship. Rather than evaluati…

  4. 4

    As we saw, comparison operators allow us to examine the relationship of two values. But what if we’re looking at more than two values? Logical operators, also known as boolean operators, evalua…

  5. 5

    Now that we know a bit about different operators, let’s try writing our own expressions! As we’ve seen, we can use operators to change something’s value, add other things to our program, to take …

  6. 6

    Congrats! Now you know about different operators and how they can be used to build simple programs. In this lesson, we learned: - Operators are symbols that represent different ways of modifyin…

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo