What are the variables in Python?
Variables are used to store data. They take memory space based on the type of value we assign to them.
How to create a variable in python?
Creating variables in Python is simple, you just have to write the variable name on the left side of = and the value on the right side, as shown below.
Variable name – Identifiers
The variable name is known as the identifier. There are a few rules that you have to follow while naming the variables in Python.
The name of the variable must always start with either a letter or an underscore (_). For example, _str, str, num, _num are all valid names for the variables.
The name of the variable cannot start with a number. For example, 9num is not a valid variable name.
The name of the variable cannot have special characters such as %, $, #, etc, they can only have alphanumeric characters and underscore (A to Z, a to z, 0-9 or _ ).
A variable name is a case sensitive in Python which means num and NUM are two different variables in python.