Python Basics -3

Variables

Computer generally stores the data inside memory locations, each memory location has an address associated with it. In order to access the data we need memory address, These addresses are numbers(hexadecimal number system)

So instead of that we create variables , which refer to the memory location of the data.

name = "Angelina"

Here "Angelina" is a string stored at some memory location. We don't need the address of that memory location. we can simply call the name variable and access the data ("Angelina").

Simply, variable doesn't hold the data , they just refer to the location where the actual data is stored.

Syntax (python)

name = "Angelina" 
age = 24 
salary = 84000.25

Here we have 3 variables name, age, salary

In python a datatype of value that variable is holding can change unlike Java, C etc..

number = 25 
number = "hello" 
number = 24.7

our number variable had a value of int data type then string and finally float.