Skip to main content

16.3 Variables

Learning objective

Now that you have Colab set up, it's time to start learning Python! The first concept you'll tackle is variables. Variables are one of the fundamental building blocks of programming. In this checkpoint, you will learn what variables are, why they're useful, and the different kinds of data types a variable can take on in Python.

By the end of this checkpoint, you should be able to do the following:

  • Read and execute code that includes variables in a Jupyter Notebook

What is a variable?​

Simply put, a variable is a name that is attached to a value.

Variables give you a shorthand way to refer to values created elsewhere in a program. You can declare and define a variable once, then pass that value around in your code without having to rewrite the value each time.

Look at the example below. After the Jupyter Notebook below loads, read over the code in the first cell, then execute it.

🚧 The lesson is being updated as you read.