1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Python

Exercise

Variable Assignment

In Python, a variable allows you to refer to a value with a name. To create a variable x with a value of 5, you use =, like this example:

x = 5

You can now use the name of this variable, x, instead of the actual value, 5.

Remember, = in Python means assignment, it doesn't test equality!

Instructions

100 XP
  • Create a variable savings with the value of 100.
  • Check out this variable by typing print(savings) in the script.