codicious.com Uncategorized Initializing variables and storing values in python

Initializing variables and storing values in python

First let us know what is a value and variable?
A variable is something that stores specific value in it.
Now let's look into some basic examples how it works.
variable1 = 10 #line 1
variable2 = 3500 #line2
From the above example, 
value is 10, variable name is variable1. Value 10 is stored in variable1.
In the same way variable2 stores a value of 3500.

The name of a variable can be anything but starts with characters or _.
The code below is a simple way of initializing variables.
a1 = 10
_a = 10
The variable name cannot be started with numbers, special characters and blank spaces. The code gives syntax error as shown below.

Leave a Reply

Your email address will not be published.